Check entrypoint array for emptyness

The entrypoint array of BuildahConfigSettings might be empty. It makes
no sense to push the `--entrypoint` argument then, thus breaking the
`convertArrayToStringArg` method.

Closes #136
This commit is contained in:
Sebastian Grabowski 2024-04-27 00:34:28 +02:00
parent 7a95fa7ee0
commit fdef902b06
No known key found for this signature in database
GPG key ID: 6030CFD8428BE75E
3 changed files with 3 additions and 3 deletions

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View file

@ -146,7 +146,7 @@ export class BuildahCli implements Buildah {
core.debug("config"); core.debug("config");
core.debug(container); core.debug(container);
const args: string[] = [ "config" ]; const args: string[] = [ "config" ];
if (settings.entrypoint) { if (settings.entrypoint && settings.entrypoint.length > 0) {
args.push("--entrypoint"); args.push("--entrypoint");
args.push(BuildahCli.convertArrayToStringArg(settings.entrypoint)); args.push(BuildahCli.convertArrayToStringArg(settings.entrypoint));
} }