Skip to content

Commit 52dfbef

Browse files
authored
fix: ensure imageNames are not empty strings (#303)
In Typescript/Javascript an empty string split on newline is going to produce an array with an empty string. => "".split('\n') [""] This causes the action to produce a warning, unless `pull-images` is set to false. Failed to get dockerfile path for image : Error: The process '/usr/bin/docker' failed with exit code 1 Filtering the list to remove any zero-length strings from the array solves this issue. Signed-off-by: Morten Linderud <morten.linderud@nrk.no>
1 parent 074d812 commit 52dfbef

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/utilities/dockerUtils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ export async function getDeploymentConfig(): Promise<DeploymentConfig> {
2323
)
2424
}
2525

26-
const imageNames = core.getInput('images').split('\n') || []
26+
const imageNames =
27+
core
28+
.getInput('images')
29+
.split('\n')
30+
.filter((image) => image.length > 0) || []
2731
const imageDockerfilePathMap: {[id: string]: string} = {}
2832

2933
const pullImages = !(core.getInput('pull-images').toLowerCase() === 'false')

0 commit comments

Comments
 (0)