mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 02:54:26 +00:00
The sync job force-pushed the source repository's main onto this one so that `origin/main` would mean "upstream main" for the three consumers that diff against it. Carrying .github/workflows/** in that push is what GitHub refuses for an App token, and `workflows` is not a GITHUB_TOKEN permission scope, so the job needed an app installation that may write workflow files. Run 37169357364 showed the fork has no such secret at all. Nothing reads the pushed branch. push_ci_policy.sh, affected_roles.sh and new_roles.sh each fetch `origin main` into their own runner's clone before reading it, and no caller queries the branch through the API. Pointing those fetches at the configured source repository gives the same baseline read-only: no push, no credential, no app permission to widen. baseline_remote.sh resolves where that baseline comes from and keeps the normalization and the disabled-value list in one place: `origin` for the source repository itself, for a disabled sync and for a local clone without GITHUB_REPOSITORY, and the upstream fetch URL otherwise. The fetches now carry an explicit `main:refs/remotes/origin/main` refspec, which a URL needs and a remote name tolerates. The release guard keeps fetching `origin`: it asks whether a tag commit sits on this repository's own main, which is a different question from the diff baseline. Removed: the sync-main job, its `needs` edge, main_from_repository.sh and the directory that held it. test_diff_affected_roles.py copies only the script under test into its fixture, so it needed the new helper too. It also inherited the full environment, and a GITHUB_REPOSITORY present in CI would have sent the fixture's baseline fetch to the real upstream instead of its own bare remote: three of its five cases fail that way, and the run takes 24s instead of 0.3s because it goes to the network. The variable is now dropped alongside BASH_ENV. Verified by running the helper in all four contexts and affected_roles.sh from an empty refs/remotes/origin/main in a scratch clone as the fork, as the source repository and locally; each populated the ref and completed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
796 B
796 B
Resolve Scripts
This directory contains scripts that resolve metadata and derived values used by the project.
- 🧩 Derive runtime values from repository and workflow context
- 🔍 Resolve identifiers, references, and computed inputs
- 🗂️ Keep lookup and resolution logic grouped in one place
Examples in this folder and its subfolders:
baseline_remote.shresolves the remote whose main CI diffs againstrepository/name.shresolves the concrete repository name once for callersrepository/owner.shresolves the concrete repository owner once for callers- See pr/README.md for the Pull Request-specific resolvers.
The scope of this folder is value resolution. Build, release, and wait-oriented behavior should stay in their dedicated script directories.