Skip to content

Commit a4f2e82

Browse files
fix(ci): trust the checkout inside image-push-manual's bazel-ci container
git rev-parse fails silently with "dubious ownership" (CVE-2022-24765) when the bazel-ci container job runs against a checkout owned by the runner host's UID, so workspace_status.sh falls back to the literal "unknown" and event-ledger's manual-dispatch images embed mr-unknown instead of a real short SHA.
1 parent 605e8d3 commit a4f2e82

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/image-push-manual.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,16 @@ jobs:
143143
- name: Checkout
144144
uses: actions/checkout@v4
145145

146+
# actions/checkout runs on the runner host; this job's steps run inside
147+
# the bazel-ci container, which mounts that checkout under a different
148+
# UID. Since git 2.35.2 (CVE-2022-24765) git refuses to operate on a
149+
# repo it does not own ("detected dubious ownership"), which makes
150+
# workspace_status.sh's `git rev-parse --short HEAD` fail silently
151+
# (stderr redirected) and fall back to the literal "unknown", landing
152+
# in the built binary as `mr-unknown` instead of a real short SHA.
153+
- name: Trust the checkout inside the container
154+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
155+
146156
- name: Resolve service name for cache keys
147157
id: svc
148158
env:

0 commit comments

Comments
 (0)