Skip to content

fix(needs-triage): respect issue label removals - #204

Open
caugner wants to merge 6 commits into
mainfrom
needs-triage-event-history
Open

caugner wants to merge 6 commits into
mainfrom
needs-triage-event-history

Conversation

@caugner

@caugner caugner commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Description

Update the needs-triage workflow to check paginated issue event history before adding the configured label.

  • Skip adding the label only when a matching unlabeled event occurred after the triggering event.
  • Replace the gh issue edit step with actions/github-script, pinned to v9.0.0.
  • Document the new behavior in docs/needs-triage.md.

Motivation

Preserve maintainer label removals made while the opened, reopened, or transferred workflow is starting.

Additional details

Use issue.updated_at from the triggering payload as the cutoff for opened, reopened, and transferred events. The payload is a snapshot taken at event time, so it equals created_at for freshly opened issues. Other event types retain the existing add behavior.

Manual validation in mdn/needs-triage-test:

  • An issue without the label and no later removal received needs triage (issue #1).
  • An unlabeled event after opened kept the label off (issue #2, run).
  • Reopening after that removal added the label, confirming the earlier removal did not suppress it (run).

All three workflow runs completed successfully: run 1, run 2, and run 3.

Related issues and pull requests

@caugner
caugner force-pushed the needs-triage-event-history branch from 6f814f1 to 222dc37 Compare October 12, 2026 17:30
@caugner
caugner marked this pull request as ready for review October 12, 2026 19:12
@caugner
caugner requested a review from a team as a code owner October 12, 2026 19:12
@caugner
caugner requested a review from LeoMcA October 12, 2026 19:12
Comment thread .github/workflows/needs-triage.yml Outdated
Comment thread .github/workflows/needs-triage.yml Outdated
@caugner
caugner marked this pull request as draft October 15, 2026 10:09
Match the SHA-pinned actions elsewhere in this repo so Dependabot can bump it.
The `transferred` event fires in the source repository, where `changes.new_issue`
describes an issue the token cannot act on. Use `issue.updated_at` of the issue
being labeled instead; destination repositories handle transfers via `opened`.
…amps

The payload is a snapshot taken at event time, so `updated_at` equals
`created_at` for a freshly opened issue and the `changes.old_issue` check
is redundant.
@caugner
caugner marked this pull request as ready for review October 22, 2026 16:09
@caugner
caugner requested a review from a team as a code owner October 22, 2026 16:09
@caugner
caugner requested a review from pepelsbey October 22, 2026 16:09
@caugner

caugner commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor Author

I wonder if we should "own" the docs/ in this repo? (cc @mdn/content-team)

@caugner
caugner requested a review from LeoMcA October 22, 2026 21:30
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.

3 participants