mirror of
https://github.com/firecow/gitlab-ci-local.git
synced 2026-02-07 00:25:45 +01:00
Some checks failed
build / unused-deps (push) Has been cancelled
build / yamllint (push) Has been cancelled
build / smoke-test (push) Has been cancelled
build / eslint (push) Has been cancelled
build / jest (push) Has been cancelled
build / CodeQL (push) Has been cancelled
* Fix environment-scoped variables with matrix jobs When using parallel matrix jobs with dynamic environment names (e.g., `environment: name: $CLUSTER`), all matrix jobs after the first one received the wrong environment-scoped variables. Root cause: When `jobData.environment` is an object, it was assigned by reference instead of being cloned. The subsequent mutation of `this.environment.name` during variable expansion would affect all matrix job instances sharing the same `jobData` object. Fix: Clone the environment object using spread operator when it's an object, similar to how `predefinedVariables` is handled in parser.ts line 182. Fixes #1725 * Add regression test for environment object cloning fix (#1725) This test verifies that the environment object is properly cloned (using spread operator) to prevent shared mutation between matrix jobs. The test reads src/job.ts and checks for the spread operator pattern, ensuring the fix cannot be accidentally removed. * Fix linting: add YAML document start and fix object spacing --------- Co-authored-by: Renier <renier.velazco@lmco.com>