mirror of
https://github.com/redhat-actions/push-to-registry.git
synced 2025-02-23 10:31:22 +01:00
Fix error message in logs when image is not present in docker (#34)
Signed-off-by: divyansh42 <diagrawa@redhat.com>
This commit is contained in:
parent
ae3d342a76
commit
b5dbf66601
3 changed files with 32 additions and 19 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
17
src/index.ts
17
src/index.ts
|
@ -227,7 +227,7 @@ async function pullImageFromDocker(): Promise<ImageStorageCheckResult> {
|
||||||
const commandResult: ExecResult = await execute(
|
const commandResult: ExecResult = await execute(
|
||||||
await getPodmanPath(),
|
await getPodmanPath(),
|
||||||
[ "pull", `docker-daemon:${imageWithTag}` ],
|
[ "pull", `docker-daemon:${imageWithTag}` ],
|
||||||
{ ignoreReturnCode: true, failOnStdErr: false }
|
{ ignoreReturnCode: true, failOnStdErr: false, group: true }
|
||||||
);
|
);
|
||||||
if (!commandResult.exitCode) {
|
if (!commandResult.exitCode) {
|
||||||
foundTags.push(tag);
|
foundTags.push(tag);
|
||||||
|
@ -326,7 +326,7 @@ async function removeDockerImage(): Promise<void> {
|
||||||
async function execute(
|
async function execute(
|
||||||
executable: string,
|
executable: string,
|
||||||
args: string[],
|
args: string[],
|
||||||
execOptions: exec.ExecOptions = {},
|
execOptions: exec.ExecOptions & { group?: boolean } = {},
|
||||||
): Promise<ExecResult> {
|
): Promise<ExecResult> {
|
||||||
let stdout = "";
|
let stdout = "";
|
||||||
let stderr = "";
|
let stderr = "";
|
||||||
|
@ -343,6 +343,12 @@ async function execute(
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (execOptions.group) {
|
||||||
|
const groupName = [ executable, ...args ].join(" ");
|
||||||
|
core.startGroup(groupName);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
const exitCode = await exec.exec(executable, args, finalExecOptions);
|
const exitCode = await exec.exec(executable, args, finalExecOptions);
|
||||||
|
|
||||||
if (execOptions.ignoreReturnCode !== true && exitCode !== 0) {
|
if (execOptions.ignoreReturnCode !== true && exitCode !== 0) {
|
||||||
|
@ -360,6 +366,13 @@ async function execute(
|
||||||
stdout,
|
stdout,
|
||||||
stderr,
|
stderr,
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
finally {
|
||||||
|
if (execOptions.group) {
|
||||||
|
core.endGroup();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
run()
|
run()
|
||||||
|
|
Loading…
Add table
Reference in a new issue