Whitelist CI_PROJECT_DIR for git safe.directory in release beta
Summary
- Fixes the
release betajob failing withfatal: detected dubious ownership in repository at '/builds/gitlab-runner'. - Adds one line —
git config --global --add safe.directory "$CI_PROJECT_DIR"— before thegit describecall in therelease betajob.
Why
The Kubernetes executor's init-permissions container runs as root; the build container runs as a different user. Git's CVE-2022-24765 protection refuses to operate on a working tree whose UID doesn't match the
process UID. The build image recently picked up a Git version that enforces this, breaking every beta release pipeline. Scoping the whitelist to $CI_PROJECT_DIR keeps the bypass tight; the wildcard form was
avoided deliberately.
release stable and other CI jobs were audited and do not invoke Git against the working tree, so this is the only change needed.
Closes #598 (closed)
Test plan
- Pipeline on this MR completes successfully (the
release betajob won't run on a branch pipeline, but lint/unit jobs validate the YAML). - After merge, the next
mainpipeline'srelease betajob succeeds and publishes the chart to the S3 beta repo. -
helm repo update gitlab-runner-betaon a clean client sees a new version with a<timestamp>-<count>-g<sha>suffix (format preserved).