mirror of
https://github.com/redhat-actions/push-to-registry.git
synced 2025-02-22 02:01:21 +01:00
Print image digest after every push
Signed-off-by: Tim Etchells <tetchell@redhat.com>
This commit is contained in:
parent
74b235b626
commit
e8a67de103
4 changed files with 12 additions and 10 deletions
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
0
git-hooks/pre-commit
Normal file → Executable file
0
git-hooks/pre-commit
Normal file → Executable file
18
src/index.ts
18
src/index.ts
|
@ -183,15 +183,17 @@ async function run(): Promise<void> {
|
|||
core.info(`Successfully pushed ${imageWithTag} to ${registryPath}`);
|
||||
|
||||
registryPathList.push(registryPath);
|
||||
}
|
||||
|
||||
try {
|
||||
const digest = (await fs.promises.readFile(digestFile)).toString();
|
||||
core.info(digest);
|
||||
core.setOutput(Outputs.DIGEST, digest);
|
||||
}
|
||||
catch (err) {
|
||||
core.warning(`Failed to read digest file "${digestFile}": ${err}`);
|
||||
try {
|
||||
const digest = (await fs.promises.readFile(digestFile)).toString();
|
||||
core.info(digest);
|
||||
// the digest should be the same for every image, but we log it every time
|
||||
// due to https://github.com/redhat-actions/push-to-registry/issues/26
|
||||
core.setOutput(Outputs.DIGEST, digest);
|
||||
}
|
||||
catch (err) {
|
||||
core.warning(`Failed to read digest file "${digestFile}": ${err}`);
|
||||
}
|
||||
}
|
||||
|
||||
core.setOutput(Outputs.REGISTRY_PATHS, JSON.stringify(registryPathList));
|
||||
|
|
Loading…
Add table
Reference in a new issue