Skip to content

Commit 291bae5

Browse files
authored
Merge pull request #470 from crazy-max/fix-outputs
Don't set outputs if empty or nil
2 parents a41d90b + 91520df commit 291bae5

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

dist/index.js

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/buildx.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export async function getImageID(): Promise<string | undefined> {
1515
if (!fs.existsSync(iidFile)) {
1616
return undefined;
1717
}
18-
return fs.readFileSync(iidFile, {encoding: 'utf-8'});
18+
return fs.readFileSync(iidFile, {encoding: 'utf-8'}).trim();
1919
}
2020

2121
export async function getMetadataFile(): Promise<string> {
@@ -27,7 +27,11 @@ export async function getMetadata(): Promise<string | undefined> {
2727
if (!fs.existsSync(metadataFile)) {
2828
return undefined;
2929
}
30-
return fs.readFileSync(metadataFile, {encoding: 'utf-8'});
30+
const content = fs.readFileSync(metadataFile, {encoding: 'utf-8'}).trim();
31+
if (content === 'null') {
32+
return undefined;
33+
}
34+
return content;
3135
}
3236

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

0 commit comments

Comments
 (0)