fix: remove PR action allowlist from track_progress validation#1181
Open
qozle wants to merge 2 commits intoanthropics:mainfrom
Open
fix: remove PR action allowlist from track_progress validation#1181qozle wants to merge 2 commits intoanthropics:mainfrom
qozle wants to merge 2 commits intoanthropics:mainfrom
Conversation
validateTrackProgressEvent rejected pull_request.labeled with an error, even though the labeled event provides the same PR number and commit SHA as opened/synchronize — all the data track_progress needs is present. Add "labeled" to the validActions list and to detectMode's supportedActions so labeled-triggered PR workflows get tag mode when track_progress is true. Fixes anthropics#1095
validateTrackProgressEvent blocked pull_request.labeled (and any other non-listed action like unlabeled, edited, assigned) with a throw, even though track_progress only needs pull_request.number to post comments — which every pull_request action provides. The action-level check was over-engineered: the event-type check already ensures we have a pull_request event with a PR number. Remove the block entirely rather than patching the list. Tests updated: pull_request.labeled and pull_request.closed both return "tag" mode when track_progress is true. workflow_dispatch still throws. Fixes anthropics#1095
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.
Problem
track_progress: truethrows onpull_request: [labeled](and any other non-listed action likeunlabeled,edited,assigned):Root cause
validateTrackProgressEventhad a secondary check that restrictedpull_requestevents to a hardcoded action list. Buttrack_progressonly needspull_request.numberto post progress comments — which everypull_requestaction provides. The action-level restriction was over-engineered and had no protective purpose.Fix
Remove the
// Additionally validate PR actionsblock entirely. The event-type check (pull_requestis valid,workflow_dispatchthrows) is the correct gate.Extending the list would have been a patch that breaks again for the next unlisted action. Removing it is the correct fix.
Changes
src/modes/detector.ts: delete the 14-line PR action validation blocktest/modes/detector.test.ts: update old "unsupported action" test (nowclosedreturns "tag"); add test forlabeledAll 16 detector tests pass.
Fixes #1095