Closed PigeonF closed 1 month ago
Minimal .gitlab-ci.yml illustrating the issue
--- job: image: docker.io/busybox script: - echo "Hello" > hello.txt artifacts: paths: - hello.txt
Compare the following ways to run gitlab-ci-local
gitlab-ci-local
$ gitlab-ci-local --no-artifacts-to-source $ ls hello.txt "hello.txt": No such file or directory
$ GCL_ARTIFACTS_TO_SOURCE=false gitlab-ci-local $ ls hello.txt "hello.txt": No such file or directory
.gitlab-ci-local-env
$ cat .gitlab-ci-local-env ARTIFACTS_TO_SOURCE=false $ gitlab-ci-local $ ls hello.txt hello.txt
As far as I can tell, the issue is that the command line option gets a default value assigned in index.ts
index.ts
https://github.com/firecow/gitlab-ci-local/blob/d44cedb180f718c4af09870809124d4b44546b03/src/index.ts#L213-L218
and then in argv.ts the value is only overriden if it was undefined before
argv.ts
https://github.com/firecow/gitlab-ci-local/blob/d44cedb180f718c4af09870809124d4b44546b03/src/argv.ts#L71-L73
This should apply to all command line options with a default value.
Yup, we cannot use yargs default values, when doing overrides like we do.
Minimal .gitlab-ci.yml illustrating the issue
Compare the following ways to run
gitlab-ci-local
.gitlab-ci-local-env
(this does not work)As far as I can tell, the issue is that the command line option gets a default value assigned in
index.ts
https://github.com/firecow/gitlab-ci-local/blob/d44cedb180f718c4af09870809124d4b44546b03/src/index.ts#L213-L218
and then in
argv.ts
the value is only overriden if it was undefined beforehttps://github.com/firecow/gitlab-ci-local/blob/d44cedb180f718c4af09870809124d4b44546b03/src/argv.ts#L71-L73
This should apply to all command line options with a default value.