Skip to content

Commit d4bc5ae

Browse files
committed
Pass stderr output for silent execution
1 parent 01c4ff8 commit d4bc5ae

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/ImageDetector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import * as core from '@actions/core'
44
export class ImageDetector {
55
async getExistingImages(): Promise<string[]> {
66
const existingSet = new Set<string>([])
7-
const ids = (await exec.exec(`docker image ls -q`, [], { silent: true })).stdoutStr.split(`\n`).filter(id => id !== ``)
8-
const repotags = (await exec.exec(`docker`, `image ls --format {{.Repository}}:{{.Tag}} --filter dangling=false`.split(' '), { silent: true })).stdoutStr.split(`\n`).filter(id => id !== ``);
7+
const ids = (await exec.exec(`docker image ls -q`, [], { silent: true, listeners: { stderr: console.warn }})).stdoutStr.split(`\n`).filter(id => id !== ``)
8+
const repotags = (await exec.exec(`docker`, `image ls --format {{.Repository}}:{{.Tag}} --filter dangling=false`.split(' '), { silent: true, listeners: { stderr: console.warn }})).stdoutStr.split(`\n`).filter(id => id !== ``);
99
core.debug(JSON.stringify({ log: "getExistingImages", ids, repotags }));
1010
([...ids, ...repotags]).forEach(image => existingSet.add(image))
1111
core.debug(JSON.stringify({ existingSet }))

src/LayerCache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class LayerCache {
6161
}
6262

6363
private async getAllImageIdsFrom(repotag: string): Promise<string[]> {
64-
const { stdoutStr: rawHistoryIds } = await this.exec(`docker history -q`, [repotag], { silent: true })
64+
const { stdoutStr: rawHistoryIds } = await this.exec(`docker history -q`, [repotag], { silent: true, listeners: { stderr: console.warn }})
6565
const historyIds = rawHistoryIds.split(`\n`).filter(id => id !== `<missing>` && id !== ``)
6666
return historyIds
6767
}

0 commit comments

Comments
 (0)