Repository navigation
fix(pr-triage): skip the job for a title or body edit and another label - #264
Merged
Merged
Conversation
The caller runs on edited and labeled. An edited event that changes only the title or the body, and a labeled event with a label other than ready-for-human, change no triage result, but each started a runner and cost 1 billed minute in a private repository. A job-level if: in the reusable workflow now skips both, so no caller changes. An edited event with a base change still runs the levels step at the new base SHA. Closes #237.
…lines exactly The source-regex guard missed bracket and destructured reads. Each step now runs on an event wrapped in a Proxy that records reads of pull_request.title, pull_request.body and event.changes. The matrix test evaluates the expected conditions, and a closed list matches the 5 if: lines of the workflow exactly, instead of a reader by indentation.
…eteness A line scan of YAML cannot prove that the workflow has no other condition (an escaped key decodes to if). The test now checks that each of the 4 expected conditions is in the workflow as 1 exact line, and evaluates them; the behavioral guard checks what the steps read.
bketelsen
approved these changes
Nov 15, 2026
This was referenced Nov 22, 2026
Merged
Merged
Merged
ci: pin core pr-triage workflow to f99acfd (retry of 5xx and network errors)
frostyard/frostmail#369
Merged
ci: pin core pr-triage workflow to f99acfd (retry of 5xx and network errors)
frostyard/frostmarks#13
Merged
Merged
Merged
ci: pin core pr-triage workflow to f99acfd (retry of 5xx and network errors)
bketelsen/trimlights#86
Merged
Merged
Merged
Merged
ci: pin core pr-triage workflow to f99acfd (retry of 5xx and network errors)
frostyard/testsuite#100
Merged
Merged
This was referenced Nov 22, 2026
Merged
Merged
ci: pin core pr-triage workflow to f99acfd (retry of 5xx and network errors)
frostyard/chairlift#330
Merged
Merged
Merged
Merged
Merged
Closed
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.
Summary
Closes #237.
The PR triage caller runs on
pull_request_targettypesopened,synchronize,reopened,editedandlabeled. Two kinds of event started a runner for no result:editedthat changes only the title or the body. Thelevelsstep ran again on the same base and the same files. In frostyard/pocket this was about 24% of the triage runs (the count and its source are in pr-triage: the caller runs a job for every edited event, also when only the title or body changed #237).labeledwith a label other thanready-for-human. No step ran.Each such run costs 1 billed minute in a private repository.
The fix is 1 job-level
if:in the reusable workflow.github/workflows/pr-triage.yml:In a reusable workflow,
github.eventis the caller's event. So no caller changes, and the baseline checks of the caller lines in other repositories need no change. Each repository gets the fix when it moves its core SHA pin. A skipped job starts no runner. Its checkpr-triage / pr-triageshows as skipped. It is not a required check, and thereadinessstep already leaves out check runs whose name starts withpr-triage.Kept: an
editedevent with a base change (changes.baseis in the payload) still runslevelsat the new base SHA, as risk-paths rule E needs.opened,synchronize,reopenedandlabeledwithready-for-humanare unchanged. A title edit is skipped too: neither library reads the PR title or body. A new test fails if one starts to.Docs:
docs/specs/pr-triage.md(interface row, a short table, rule A, readiness rules),docs/specs/risk-paths.mdrule E,docs/design/pr-triage-rollout.md. ADR-0077 lists the caller's 5 types; the caller still has them, so it stays true.Risk tier
Risk tier: highest (
risk:high, L2).Matched risk path (
.github/risk-paths.jsonat the base,levelOfFile):.github/workflows/pr-triage.yml.github/workflows/**if:line on the job, plus 4 comment lines. No permission, token, action, trigger, step or embedded library changes (npm run sync:risk-paths-workflow:already in sync). The condition only skips events; it never runs the job on an event that ran no job before. It reads only the caller's event payload, no PR head content.The other 4 files are at L3 (default).
Docs housekeeping
Verification
make cigreen locally: 953 tests pass at the head, docs, corrections and risk-paths gates ok.permissions: {}unchanged.test/pr-triage.test.mjs:==coercion rules; any unknown token or function throws), with its own unit test.levels,readiness, Dependabot shadow) must be in the workflow as 1 exact line; the test evaluates them over 9 events × 2 authors × 2dependabot-shadowvalues. The job runs exactly when some step would run and the event is not a title or body edit. Named cases: body-only edit, title-only edit andlabeled documentationskip; base edit runslevels;labeled ready-for-humanrunsreadiness. It does not claim that the workflow has no other condition.levelson opened, synchronize and a base edit;readinesson synchronize and labeled;shadow) runs on an event wrapped in aProxythat records reads ofpull_request.title,pull_request.bodyandevent.changes(get,in, descriptor and enumeration), after its expected outcome is asserted. A self-test shows that computed, destructured,inand spread reads are recorded. Checked on purpose: a destructuredbodyread added torunReadinessStepin a scratch worktree makes this test fail.if:line..memory/corrections/2026-11-15-pr-264-behavioral-field-guard.json(the cross-review findings below;check-corrections: 56 records ok).origin/main(workflow without the fix) with the new test file,node --test test/pr-triage.test.mjs: 2 fail on assertions, "the workflow has the input, the job, the permissions and no checkout" and "the job if: skips a title or body edit and a label other than ready-for-human" (at "the workflow has the line if: ${{ (github.event.action != 'edited' ... }}").make ciat head33da635: 953 tests pass.pull_request_target), so this PR still runs the old job; the first live skip shows on a body edit of a core PR after this merges.Cross-review
Reviewer
openai/gpt-6.1-sol; coderdeepseek/deepseek-flash(primary), with edits byanthropic/claude-opus-5-5. Basecc6caf0bf37c0772bdd58654dd2d9825d2fc8371.a12c225pr["body"],const { body } = prandevent["changes"]; theif:extraction read YAML by indentation with no input-shape cases. Workflow condition and docs confirmed correct.Proxyguard; exact conditions as constants; correction record.dc6354cif:lines missed an escaped key ("\u0069f":), so its fail-closed claim was false. Guard finding resolved.33da635The reviewer ran no tests (read-only); the test results above are the author's.