mirror of
https://github.com/docker/build-push-action.git
synced 2025-06-23 19:08:00 +02:00
Don't set outputs if empty or nil
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
8
dist/index.js
generated
vendored
8
dist/index.js
generated
vendored
@ -57,7 +57,7 @@ function getImageID() {
|
||||
if (!fs_1.default.existsSync(iidFile)) {
|
||||
return undefined;
|
||||
}
|
||||
return fs_1.default.readFileSync(iidFile, { encoding: 'utf-8' });
|
||||
return fs_1.default.readFileSync(iidFile, { encoding: 'utf-8' }).trim();
|
||||
});
|
||||
}
|
||||
exports.getImageID = getImageID;
|
||||
@ -73,7 +73,11 @@ function getMetadata() {
|
||||
if (!fs_1.default.existsSync(metadataFile)) {
|
||||
return undefined;
|
||||
}
|
||||
return fs_1.default.readFileSync(metadataFile, { encoding: 'utf-8' });
|
||||
const content = fs_1.default.readFileSync(metadataFile, { encoding: 'utf-8' }).trim();
|
||||
if (content === 'null') {
|
||||
return undefined;
|
||||
}
|
||||
return content;
|
||||
});
|
||||
}
|
||||
exports.getMetadata = getMetadata;
|
||||
|
Reference in New Issue
Block a user