Repository navigation
ci: build the dev release only from pushes to this repository - #81
Merged
Merged
Conversation
The workflow_run `branches` filter matches the head branch name only, so a ci run for a pull request from a fork whose branch is called main also triggered dev-build, which checked out and built that pull request's commit with a contents: write token. dev-build now requires the ci run to be a push to this repository (or a manual dispatch). Also in dev-build and release: - checkout no longer writes the token into .git/config (the publish steps pass it in env). - setup-go cache is off, so release and dev builds never restore a cache another run saved. - actions are pinned to commit SHAs. - the dev-build commit SHA reaches the publish script through env, not inline interpolation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sreya
approved these changes
Nov 18, 2026
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the release-workflow hardening changes.
No open issues 🎉
What changed in this PR
Hardens the release workflows against untrusted build inputs, preventing fork pull-request CI runs from triggering dev publication.
Changes:
- Restricts automatic dev builds to successful CI runs from pushes to this repository, while preserving manual dispatch.
- Pins actions to commit SHAs and disables persisted checkout credentials and Go caching in both publishing workflows.
- Passes the dev commit SHA through an environment variable instead of interpolating it into the shell script.
| File | Description |
|---|---|
.github/workflows/release.yml |
Pins actions and disables checkout credential persistence and Go caching. |
.github/workflows/dev.yml |
Adds the CI provenance gate, applies the same hardening, and passes the publish SHA through the environment. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dev-buildruns onworkflow_runofci, withbranches: [main]. That filter only compares the head branch name, so acirun for a pull request from a fork whose branch is calledmainalso matched.dev-buildthen checked out that run'shead_shaand built it withcontents: write, which publishes thedevrelease (llm-helper upgrade --channel dev).Changes
dev.yml: the job runs onworkflow_dispatch, or after a successfulcirun whoseeventispushand whosehead_repositoryis this repository.dev.yml,release.yml:persist-credentials: false. The publish steps already pass the token inenv.dev.yml,release.yml:setup-gowithcache: false, so release and dev builds don't restore a cache another run saved.envrather than inline${{ }}.Pushes to main and manual dispatches behave as before.
🤖 Generated with Claude Code