firecow / gitlab-ci-local

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

Incorrect nested variable expansion #1097

Closed ANGkeith closed 6 months ago

ANGkeith commented 6 months ago

Minimal .gitlab-ci.yml illustrating the issue

---
variables:
  DEV_URL: dev-url
  URL_DEV: url-dev

.script:
  script:
    - echo $URL

test ${URL_${ENV}}:
  extends: .script
  variables:
    URL: ${URL_${ENV}}
    ENV: DEV

test ${${ENV}_URL}:
  extends: .script
  variables:
    URL: ${${ENV}_URL}
    ENV: DEV

Expected behavior https://gitlab.com/ANGkeith/gitlab-ci-local-test/-/commit/34b50e3b66690dd23ba63454cefcd2e54700c642

Current behavior image