Skip to content

fix: remove PR action allowlist from track_progress validation#1181

Open
qozle wants to merge 2 commits intoanthropics:mainfrom
qozle:fix/track-progress-labeled-action
Open

fix: remove PR action allowlist from track_progress validation#1181
qozle wants to merge 2 commits intoanthropics:mainfrom
qozle:fix/track-progress-labeled-action

Conversation

@qozle
Copy link
Copy Markdown
Contributor

@qozle qozle commented Apr 5, 2026

Problem

track_progress: true throws on pull_request: [labeled] (and any other non-listed action like unlabeled, edited, assigned):

Error: track_progress for pull_request events is only supported for actions:
opened, synchronize, ready_for_review, reopened. Current action: labeled

Root cause

validateTrackProgressEvent had a secondary check that restricted pull_request events to a hardcoded action list. But track_progress only needs pull_request.number to post progress comments — which every pull_request action provides. The action-level restriction was over-engineered and had no protective purpose.

Fix

Remove the // Additionally validate PR actions block entirely. The event-type check (pull_request is valid, workflow_dispatch throws) 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 block
  • test/modes/detector.test.ts: update old "unsupported action" test (now closed returns "tag"); add test for labeled

All 16 detector tests pass.

Fixes #1095

qozle added 2 commits April 5, 2026 17:59
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

track_progress should support pull_request 'labeled' action

1 participant