Skip to content

Commit

Permalink
Merge pull request #470 from crazy-max/fix-outputs
Browse files Browse the repository at this point in the history
Don't set outputs if empty or nil
  • Loading branch information
crazy-max committed Sep 24, 2021
2 parents a41d90b + 91520df commit 291bae5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions src/buildx.ts
Expand Up @@ -15,7 +15,7 @@ export async function getImageID(): Promise<string | undefined> {
if (!fs.existsSync(iidFile)) {
return undefined;
}
return fs.readFileSync(iidFile, {encoding: 'utf-8'});
return fs.readFileSync(iidFile, {encoding: 'utf-8'}).trim();
}

export async function getMetadataFile(): Promise<string> {
Expand All @@ -27,7 +27,11 @@ export async function getMetadata(): Promise<string | undefined> {
if (!fs.existsSync(metadataFile)) {
return undefined;
}
return fs.readFileSync(metadataFile, {encoding: 'utf-8'});
const content = fs.readFileSync(metadataFile, {encoding: 'utf-8'}).trim();
if (content === 'null') {
return undefined;
}
return content;
}

export async function getSecretString(kvp: string): Promise<string> {
Expand Down

0 comments on commit 291bae5

Please sign in to comment.