Skip to content

Commit 3da40bd

Browse files
fix(ci): avoid zizmor github-env finding on fork e2e sandbox name
The `Set sandbox ID` step wrote a computed value to $GITHUB_ENV, which the zizmor github-env audit flags as high severity (write to GITHUB_ENV may allow code execution). Set SANDBOX_NAME as a job-level env var instead — no $GITHUB_ENV write, so the audit does not apply. Uses github.run_id, which is unique per run; in workflow_run context GITHUB_REF is the default branch and cannot disambiguate concurrent fork runs sharing a self-hosted host. Refs: #3257 Assisted-By: Claude <[email protected]> Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent 550be05 commit 3da40bd

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎.github/workflows/e2e-fork.yaml‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,12 @@ jobs:
231231
contents: read
232232
packages: read
233233
actions: read
234+
# Set the sandbox name as a job-level env var rather than writing it to
235+
# $GITHUB_ENV from a step (which the zizmor github-env audit flags). run_id
236+
# is unique per run — in workflow_run context GITHUB_REF is the default
237+
# branch, so it can't disambiguate concurrent fork runs on a shared host.
238+
env:
239+
SANDBOX_NAME: cozy-e2e-sandbox-fork-${{ github.run_id }}
234240
steps:
235241
- name: Checkout PR merge ref
236242
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
@@ -265,8 +271,6 @@ jobs:
265271
run: |
266272
yq -i ".cozystackOperator.platformSourceUrl = \"oci://${REGISTRY}/cozystack-packages\"" packages/core/installer/values.yaml
267273
yq -i ".cozystackOperator.platformSourceRef = \"digest=${PACKAGES_DIGEST}\"" packages/core/installer/values.yaml
268-
- name: Set sandbox ID
269-
run: echo "SANDBOX_NAME=cozy-e2e-sandbox-$(echo "${GITHUB_REPOSITORY}:${GITHUB_WORKFLOW}:fork-${{ needs.resolve.outputs.pr_number }}" | sha256sum | cut -c1-10)" >> "$GITHUB_ENV"
270274
- name: Prepare workspace
271275
run: |
272276
rm -rf "/tmp/$SANDBOX_NAME"

0 commit comments

Comments
 (0)