mirror of
https://github.com/Comfy-Org/github-workflows.git
synced 2026-11-05 00:17:37 +00:00
[PR #226] [MERGED] docs(pr-risk): drop the dependabot skip from the documented caller pattern #233
Labels
No labels
cursor-review-catalog-drift
groom
groom
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/github-workflows#233
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/github-workflows/pull/226
Author: @mattmillerai
Created: 8/25/2026
Status: ✅ Merged
Merged: 8/25/2026
Merged by: @mattmillerai
Base:
main← Head:matt/be-8035-pr-risk-docs-dependabot-skip📝 Commits (2)
f22154adocs(pr-risk): drop the dependabot skip from the documented caller patternc46e0b9docs(pr-risk): sharpen the dependabot-skip rationale after review📊 Changes
3 files changed (+121 additions, -28 deletions)
View changed files
📝
.github/workflows/pr-risk.yml(+56 -20)📝
docs/callers/pr-risk.md(+43 -0)📝
scripts/pr-risk/README.md(+22 -8)📄 Description
ELI-5
The pr-risk docs told every consumer to copy an
if:line that skips Dependabot PRs. That skip was there because Dependabot's runs get a read-only token and the label write would fail — except GitHub'spermissions:key elevates that token, and pr-risk uses no secrets, so the write actually succeeds. The skip bought nothing and left each repo's highest-volume automated PR producer ungraded. This drops it from the documented pattern and explains why the fork half of the same line is still real.What changed
Docs only. No behaviour change to the reusable — its own
if:logic, its inputs, and its fork guidance are untouched (the diff contains no non-comment YAML line)..github/workflows/pr-risk.yml— the caller pattern's exampleif:drops thegithub.actor != 'dependabot[bot]'clause and keeps the fork clause; the comment above it is rewritten into two paragraphs: the fork clause is still a token guard (thepermissions:elevation does not extend to fork-PR tokens, so a fork PR is ungraded-by-absence on plainpull_request, and is gradable by dispatching onpr_numberor by enrolling withpull_request_target, which this header already endorses), and there is deliberately no dependabot clause (read-only by default, elevated by the caller'spermissions:block, no secrets declared). The second paragraph states explicitly that this reasoning does not transfer to a caller that needs an Actions secret —cursor-review-auto-label.yml's app private key is the named local example — because nopermissions:block hands a Dependabot run an Actions secret..github/workflows/pr-risk.yml, ON-DEMAND GRADING bullet — the "BOT-AUTHORED PRs ARE GRADED" bullet described the by-number path as the place bots get graded, keyed on the caller clause that is now gone. It is now "FORK PRs ARE GRADED" (the one thing that really is by-number-only) and says bots are graded on both paths, so the header and the pattern agree.docs/callers/pr-risk.md— a gotcha stating the rule positively, plus the consumer-coordination note: existing callers drop the clause in their own repos, andbump-pr-risk-callers.ymlmoves SHA pins only and will never edit anif:, so a caller that mirrors itsif:/concurrencyshape in a repo-side unit test has to update that test in the same PR.scripts/pr-risk/README.md— the same correction where the skip was explained.Both docs cite GitHub's Troubleshooting Dependabot on GitHub Actions → "Changing
GITHUB_TOKENpermissions".Review round (
c46e0b9)Four of the panel's five findings turned into edits; all three files are still comment/prose only.
github.actoris who triggered the run, not who authored the PR, so the removed clause never keyed on bot authorship — a human pushing to a Dependabot branch made the actor human and the PR graded even with the clause in place. What it did select is exactly the read-only-token set thepermissions:block covers. Corrected inpr-risk.ymlandscripts/pr-risk/README.md, with the mechanism spelled out rather than just the label swapped.uses:pin runs the newly pinned reusable inside that PR's own run under the elevated token, where the clause used to skip it. Bounded honestly (Dependabot only proposes SHAs behind this repo's published tags; the tool checkout is separately gated onworkflows_refbeing an ancestor ofmain; the fleet's own bump PRs always had this property). The adjacent gotcha that falls out of it is now stated too: Dependabot rewritesuses:only and leavesworkflows_refstale, and theuses:/workflows_refequality check that would catch that is a deliberate open gap — fix the input in the same PR.docs/callers/pr-risk.mdand the header now agree on caller shape. The page's copy-paste block carries noif:while the header pattern does, and the new prose pointed at a clause the page never showed. Fixed by scoping rather than by editing the block: a new paragraph under the fork gotcha says why it has noif:(underpull_request_targetthe token is writable for fork PRs too; a same-repo-only repo has no fork PRs to guard), names the third shape that does need the clause — public repo staying on plainpull_request, forks ungraded rather than red — and points at the header for the event-scoped variant.pr-risk.ymlandscripts/pr-risk/README.md. Only the writable-token half explains why the fork clause does not apply on a dispatch, and the actor half contradicted the next sentence.pr-risk.ymlstill fans a SHA-bump PR across the fleet. Real — the fleet already excludesscripts/pr-risk/tests/**andscripts/pr-risk/README.mdfor exactly this reason, and a comment-only workflow-file edit is the same class but is not expressible as a path filter. The fix belongs in the sharedbump-callers.sh(safely: a#line inside arun:heredoc is not a comment) or in a commit trailer, which is a design call; tracked as a follow-up. The related half — a maintainer reading a bumped caller as current while it still carries the skip — is handled here, by thedocs/callers/pr-risk.mdnote that the fleet moves pins only and will never edit yourif:.Judgment calls
docs/callers/pr-risk.mdshowed neither the callerif:nor the dependabot skip, so the "same correction" asked for there was vacuous as written. Rather than skip it, I added the rule as a gotcha, so a consumer who reads only that page learns not to add the clause. I deliberately did not add anif:to that page's caller example — it has never carried one, and adding one would be a scope expansion beyond a docs correction.scripts/pr-risk/README.mdwas not named in the scope, but it did explain the skip in the wording being corrected. Leaving it would have left the repo contradicting itself, so it is fixed here. It is excluded from the bump fleet's path filter, so it fans no PRs.bump-pr-risk-callers.ymlwatches.github/workflows/pr-risk.ymlwith no docs carve-out (onlyscripts/pr-risk/tests/**andscripts/pr-risk/README.mdare excluded), so a header-comment-only change still bumps. That is the existing design and I did not widen the exclusion; it is arguably useful here, since the bump PR is the moment a consumer's reviewer sees the corrected header and can drop their own clause.Verification of the claim itself
The premise is load-bearing, so I checked it against the vendor docs rather than reasoning from the old comment. Troubleshooting Dependabot on GitHub Actions states, under "Changing
GITHUB_TOKENpermissions": "By default, GitHub Actions workflows triggered by Dependabot get aGITHUB_TOKENwith read-only permissions. You can use thepermissionskey in your workflow to increase the access for the token". The same page, under "Accessing secrets", states that a Dependabot-triggered workflow sees Dependabot secrets only and "GitHub Actions secrets are not available" — which is precisely the boundary of the non-transfer note above.pr-risk.ymldeclares nosecrets:and callers pass none, so it sits on the safe side of that boundary.A useful cross-check inside this repo:
pr-area-label.ymlkeeps its own dependabot skip, and its comment gives the reason this change does not apply to it — that job needs theANTHROPICsecret. So the two workflows now disagree for the right reason rather than by copy-paste.Residual
if:/concurrencyshape. The bump fleet moves pins only. Until those edits land, those repos' Dependabot PRs stay ungraded — i.e. the outcome this change exists to fix is not yet realized anywhere.pr_numberinput description still says "Bot-authored and fork PRs ARE graded on this path (see the header)". That is still true, but bot PRs are no longer distinctive of that path. I left it alone as a one-word-accurate sentence rather than widen the diff; a follow-up could tighten it to "Fork PRs".Provenance
bash scripts/pr-risk/tests/test_pin_contract.sh28 passed / 0 failed (the suite that pins theworkflows_refguard body verbatim — the named landmine);test_grade_pr_risk.sh138/0,test_grade_targets.sh105/0,test_apply_risk_label.sh48/0,test_publish_risk_surfaces.sh94/0,test_resolve_enabled.sh27/0;shellcheck -x scripts/pr-risk/*.shclean;python3 .github/workflow-pins/check_workflow_pins.py --workflows-dir .github/workflowsOK (11 workflows declareworkflows_ref, none with a default, 0 exempt);yaml.safe_loadparses the edited workflow after the review round. All re-run onc46e0b9.python3 .github/agents-md-integrity/check_agents_md.py --root .fails onAGENTS.mdbeing 305 lines against a 200-line ceiling — pre-existing onmainat the merge base, untouched by this diff. Not exercised: a live Dependabot run against a pr-risk caller (see Residual).scripts/pr-risk/README.md, and a positive gotcha instead of a vacuous correction indocs/callers/pr-risk.md) are argued under Judgment calls above. The review round inc46e0b9stayed inside that same scope — prose and comments in the same three files — and deferred the one finding whose fix lives in the bump fleet.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.