firecow / gitlab-ci-local

Tired of pushing to test your .gitlab-ci.yml?
MIT License
2.05k stars 118 forks source link

fix: cast global variable values to string #1182

Closed ANGkeith closed 3 months ago

ANGkeith commented 3 months ago

Description

Running the following,

---
variables:
  FOO: 1

job:
  image: alpine
  script:
    - echo hello

throws the following error,

TypeError: val.replace is not a function.

Additional context

Job's variables are casted to String as seen: https://github.com/firecow/gitlab-ci-local/blob/0286e76abe7bd85cb744bb5500904d58029d0de5/src/parser.ts#L121

We might have forgotten to cast the global variable

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud