Repository navigation
Ship the engine as a package (Nix flake first); stop vendoring scripts (#2) #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4fd3baf
5d3be79
84e6e35
e15200a
446b51c
cb42872
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,10 +32,38 @@ jobs: | |
| with: | ||
| python-version: "3.12" | ||
|
|
||
| # Projects that ran `make init` carry no engine copy; fetch one — | ||
| # PINNED, never floating `main`: this job runs with write | ||
| # permissions, so executing whatever is currently on upstream | ||
| # main would let an upstream change become unreviewed code | ||
| # execution here. The pin is the project's own choice, resolved | ||
| # in order: the github-project rev in flake.lock (the same pin | ||
| # Nix consumers already upgrade deliberately), the | ||
| # GHPROJECT_ENGINE_REF repository variable, the default release | ||
| # tag. The engine repo itself, and template copies that have not | ||
| # detached yet, skip both steps and use their local scripts/. | ||
| - name: Resolve the engine pin (detached consumer projects only) | ||
| id: enginepin | ||
| if: hashFiles('scripts/gh_project_update.py') == '' | ||
| run: | | ||
| rev=$(jq -r '.nodes["github-project"].locked.rev // empty' \ | ||
| flake.lock 2>/dev/null || true) | ||
| echo "ref=${rev:-${{ vars.GHPROJECT_ENGINE_REF || 'v0.2.0' }}}" \ | ||
| >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Fetch the engine (detached consumer projects only) | ||
| if: hashFiles('scripts/gh_project_update.py') == '' | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: williamdemeo/github-project | ||
| ref: ${{ steps.enginepin.outputs.ref }} | ||
| path: .github-project-engine | ||
|
Comment on lines
+56
to
+60
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confirmed — the sharpest finding of this review, and the write permissions make it a genuine supply-chain hazard rather than a determinism nit: an upstream push to main became unreviewed code execution with contents:write / pull-requests:write in every detached consumer. Fixed in cb42872: the fetch is now pinned, resolved in order — the |
||
|
|
||
| - name: Check, and update if armed | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| PROJECT_PLAN_AUTO_UPDATE: ${{ vars.PROJECT_PLAN_AUTO_UPDATE }} | ||
| GHPROJECT_DIR: .github-project-engine | ||
| # Required here. The update script strips GH_TOKEN and | ||
| # GITHUB_TOKEN by default, which is exactly how Actions | ||
| # authenticates; without this every gh call exits with a | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed — read-only permissions make this the lower-stakes sibling of the freshness-workflow finding, but the determinism argument stands on its own: a consumer commit must not change CI behavior because upstream moved. Fixed in cb42872 with the same pin resolution as there (consumer's
flake.lockrev →GHPROJECT_ENGINE_REFvariable → default release tag), so both workflows share one story and Nix consumers still have a single pin to manage.