mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-26 21:08:20 +00:00
Under pull_request_target, build-ci-images-fork builds a fork's Dockerfile on a runner whose docker config holds a packages:write token and exports the shared build cache that trusted builds read. images-mirror-missing-fork receives the Docker Hub secrets, contrary to pipeline.md, and reads the fork tree with symlinks followed. A new fork-trust-gate job fails both paths for untrusted full-scope fork pull requests until a maintainer adds the label '🛡️ Trusted' (scripts/github/gate/trusted_label.sh). Fork builds no longer export the shared cache (scripts/image/push.sh). The mirror job checks the fork tree out with core.symlinks=false, fails on any symlink (scripts/github/gate/no_symlinks.sh) and does not persist the base checkout's credentials. test_workflow_fork_checkout_gated.py fails on the old workflows and passes on the new ones; actionlint, shellcheck and ruff are clean. Behaviour change: an untrusted full-scope fork pull request turns red at the gate and gets no deploy CI until it is labelled; same-repository pull requests run as before. Open: the label survives later pushes of the fork, and it is untested whether actions/checkout honours a global core.symlinks=false. 🎯 Fix: 88 % 💥 Break: 8 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: ~100 % 🏆 Score: 81 🚦 Gate: ⛔ fix 88 % < 90, break 8 % > 5 Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
630 B
Bash
Executable File
17 lines
630 B
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Inputs via env:
|
|
# TRUSTED "true" when the fork PR carries the maintainer '🛡️ Trusted' label.
|
|
# PR_NUMBER the pull request number, named in the refusal.
|
|
|
|
set -euo pipefail
|
|
|
|
: "${TRUSTED:?}"
|
|
: "${PR_NUMBER:?}"
|
|
|
|
if [[ "${TRUSTED}" != "true" ]]; then
|
|
echo "Fork PR #${PR_NUMBER} is not labelled '🛡️ Trusted'. The privileged image build and mirror run fork content with a packages:write token, so they start only after a maintainer reviewed the head and applied the label." >&2
|
|
exit 1
|
|
fi
|
|
echo "Fork PR #${PR_NUMBER} carries '🛡️ Trusted'; the privileged image build and mirror may run."
|