Stop writing the PR number into the size label artifact - #6261
Merged
Conversation
Nothing reads it now: the apply workflow derives the number from its own workflow_run event. The write was kept only so the consumer still on the default branch, which did read it, would keep working until that change landed. It has, so the artifact carries the label alone. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ChrisJBurns
force-pushed
the
drop-pr-number-artifact
branch
from
August 10, 2026 17:33
9ffc139 to
8300561
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6261 +/- ##
==========================================
- Coverage 72.71% 72.71% -0.01%
==========================================
Files 742 742
Lines 77299 77299
==========================================
- Hits 56209 56208 -1
- Misses 17126 17127 +1
Partials 3964 3964 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jerm-dro
approved these changes
Aug 10, 2026
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
pr-number.txtany more. Derive PR number from the triggering run in the size labeler #6259 changed the apply workflow to derive the pull request number from its ownworkflow_runevent instead of from the artifact, because the artifact is produced by apull_requestworkflow and is therefore attacker-influenced. This removes the now-unused write.workflow_runconsumers always execute the copy of the workflow on the default branch, never the version in the pull request. A pull request can change the producer — which does run from the pull request head — but cannot change the consumer reading its output until it merges. Dropping the write alongside the consumer change failed the apply job on every open pull request, because the producer stopped writing the file whilemain's consumer was still reading it.So this is phase two of a two-phase rollout:
pr-number.txt; producer keeps writing itmainstill works throughoutmainCI state
#6259 is on
main, so the consumer running against this pull request is the new one that ignorespr-number.txt. The apply job passes here — the ordering hazard described above is resolved, not merely tolerated.Part of #6253
Type of change
Test plan
Unit tests (
task test)E2E tests (
task test-e2e)Linting (
task lint-fix)Manual testing (describe below)
grep -rn "pr-number.txt" .github/returns nothing across the whole directory, so producer and consumer agree.The workflow parses as YAML and
actionlintis clean on it.The end-to-end behaviour was already proven on Derive PR number from the triggering run in the size labeler #6259: after the fix, its apply runs succeeded and both Derive PR number from the triggering run in the size labeler #6259 and Gate the Claude workflow on write access, not contribution history #6260 received
size/XSthrough the new resolve-from-event path.Does this introduce a user-facing change?
No.
Special notes for reviewers
size/*labels, checked by the consumer. There is nothing left in it that can influence which pull request is acted on.Generated with Claude Code