Repository navigation
fix(ci): only release from pushes to this repo's main - #77
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The documented private-reporting channel remains unavailable until the repository setting is enabled.
1 open finding
What changed in this PR
Secures releases against fork-originated CI runs and improves workflow supply-chain safety.
Changes:
- Restricts releases to successful pushes from this repository’s
main. - Pins Actions, limits token permissions, and adds Dependabot updates.
- Adds a security policy and vulnerability-reporting guidance.
| File | Description |
|---|---|
.github/workflows/release.yml |
Hardens release gating, permissions, and Action pins. |
.github/workflows/ci.yml |
Restricts permissions and pins Actions. |
.github/dependabot.yml |
Automates Cargo and Action updates. |
SECURITY.md |
Defines support, reporting, and scope. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The release gate only checked that CI passed on a branch named main. A pull request from a fork whose branch is also called main passes that check, so its head would be built and published as the latest pre-release. Require the CI run to come from a push in this repo. Also set a read-only default token in both workflows, pin every action by commit SHA, add Dependabot for cargo and actions, and add a security policy. Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
avelino
force-pushed
the
avelino/fix/release-workflow-run-guard
branch
from
October 16, 2026 11:03
1e6d50d to
620b227
Compare
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.

release.yml runs on
workflow_runof CI, and CI runs onpull_request. The only gate wasconclusion == success && head_branch == 'main', buthead_branchis the branch name on the head repo. A fork PR from a branch calledmainpasses that, sopreparehands the fork'shead_shatobuild, andrelease-latest(contents: write) deletes and republishes thelatestpre-release with those binaries.install.shfalls back toreleases/latest/download, so that's a real path to users. Fork approval is only required for first time contributors.The gate now also requires
workflow_run.event == 'push'andworkflow_run.head_repository.full_name == github.repository:mainpushtrigger handles itSame PR, smaller stuff: top level
permissions: contents: readin ci.yml and release.yml (write stays only onrelease-latestandrelease-tag), every action pinned by commit SHA with the version in a comment (same majors, latest patch),.github/dependabot.ymlfor cargo and github-actions (weekly, grouped) so the pins don't rot, and aSECURITY.md. Private vulnerability reporting is off in the repo settings right now, I'll turn it on so the link in SECURITY.md works.How it was tested
actionlint1.7.12 with shellcheck off: clean. With shellcheck on: 12 info/style notes, the same 12 that main has today (none new).uses:line is a 40 char SHA; each SHA was resolved from its tag withgh api repos/<action>/commits/<tag>.custom_exit_codeonce,hello_world_with_shrinkonce) withcould not open .../rt-<hash>/lib/jvm.cfg; macOS and Windows were cancelled by fail-fast. The rerun passed on all three OSes. The Rust code here is identical to main, and main's Test job passed when rerun today, so it's a pre-existing flake: the stub skips extraction when$RT_DIR/binexists, and when two binaries with the same runtime start at once the second can run java while the first is still untarringlib/. Separate fix, not in this PR.latestpre-release. The fork case can't be reproduced without a fork named main, the truth table above is from theworkflow_runpayload fields.