This commit is contained in:
Vidya Reddy 2022-08-04 15:45:13 +05:30
parent 36b55e389b
commit 36041268eb
2 changed files with 7 additions and 6 deletions

View File

@ -8,7 +8,8 @@ export class DockerExec {
} }
public async pull(image: string, args: string[], silent?: boolean) { public async pull(image: string, args: string[], silent?: boolean) {
image = image.trim() image = image.replace(/^[ ]+/g, '') //Remove whitespace at beginning of the string
image = image.replace(/[ ]+$/g, '') //Remove whitespace at end of the string
const result = await this.execute(['pull', image, ...args], silent) const result = await this.execute(['pull', image, ...args], silent)
if (result.stderr != '' || result.exitCode != 0) { if (result.stderr != '' || result.exitCode != 0) {
throw new Error(`docker images pull failed: ${result.stderr}`) throw new Error(`docker images pull failed: ${result.stderr}`)

View File

@ -24,11 +24,11 @@ export async function getDeploymentConfig(): Promise<DeploymentConfig> {
} }
let imageNames = core.getInput('images').split('\n') || [] let imageNames = core.getInput('images').split('\n') || []
const imageStr = imageNames.toString() imageNames.forEach((element) => {
if (imageStr == ' ') { if (element == ' ' || '') {
const arr: string[] = [] imageNames.pop()
imageNames = arr }
} })
const imageDockerfilePathMap: {[id: string]: string} = {} const imageDockerfilePathMap: {[id: string]: string} = {}
const pullImages = !(core.getInput('pull-images').toLowerCase() === 'false') const pullImages = !(core.getInput('pull-images').toLowerCase() === 'false')