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>
19 lines
521 B
Bash
Executable File
19 lines
521 B
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Usage: no_symlinks.sh <tree>
|
|
# <tree> a directory checked out from an untrusted ref; the script fails
|
|
# when it holds a symlink, which would let a later read leave it.
|
|
|
|
set -euo pipefail
|
|
|
|
tree="${1:?Usage: no_symlinks.sh <tree>}"
|
|
|
|
mapfile -t links < <(find "${tree}" -type l -print)
|
|
|
|
if ((${#links[@]} > 0)); then
|
|
echo "Refusing ${tree}: ${#links[@]} symlink(s) survived core.symlinks=false." >&2
|
|
printf ' - %q\n' "${links[@]:0:20}" >&2
|
|
exit 1
|
|
fi
|
|
echo "No symlinks under ${tree}."
|