Skip to content

Comments

fix: fetch author_association from REST API instead of webhook payload#398

Merged
stack72 merged 1 commit intomainfrom
fix/issue-triage-author-association
Feb 19, 2026
Merged

fix: fetch author_association from REST API instead of webhook payload#398
stack72 merged 1 commit intomainfrom
fix/issue-triage-author-association

Conversation

@stack72
Copy link
Contributor

@stack72 stack72 commented Feb 19, 2026

Summary

  • The issue-triage workflow was incorrectly tagging issues opened by maintainers with needs-triage
  • Root cause: GitHub fires the issues.opened webhook before author_association is fully computed, so reading it from context.payload.issue.author_association returned a stale/incorrect value
  • Fix: replace the webhook payload lookup with a live github.rest.issues.get() call, which returns the correct value by the time the workflow runner executes (~6 seconds after issue creation)
  • Also adds core.info() logging of both the webhook and REST API values so any future discrepancy is visible in run logs

Test plan

  • Open a new issue as a maintainer and confirm the needs-triage label and welcome comment are not added
  • Check the run logs to verify both author_association values are logged and show MEMBER/OWNER/COLLABORATOR

🤖 Generated with Claude Code

The issue-triage workflow was incorrectly tagging maintainer-opened issues
with 'needs-triage'. The root cause: GitHub fires the issues.opened webhook
before author_association is fully computed, so the payload value was not
reflecting the user's actual membership. By the time the workflow runner
executes (~6 seconds later), the REST API returns the correct value.

Fix: replace context.payload.issue.author_association with a live
github.rest.issues.get() call. Also adds core.info() logging of both
values so any future mismatch is visible in the run logs.
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved

This is a clean, well-documented bug fix for the issue-triage workflow.

Review Summary

No blocking issues found.

Criteria Status Notes
Code Quality Clean, well-structured change
Code Style (CLAUDE.md) N/A - YAML workflow file, not TypeScript
DDD Principles N/A - Infrastructure code
Test Coverage Manual test plan provided in PR description
Security No vulnerabilities - uses secrets.GITHUB_TOKEN correctly, no injection risks
Bugs/Edge Cases None identified

What I Verified

  1. Root cause is correctly identified: GitHub webhook payloads can have stale author_association values for issues.opened events
  2. Fix is appropriate: Fetching via REST API allows time for GitHub to compute the correct value
  3. Logging addition is helpful: Will aid in debugging any future discrepancies
  4. Error handling: If the API call fails, the workflow will fail naturally (appropriate behavior)

The change is minimal, targeted, and solves the problem correctly.

@stack72 stack72 merged commit 375c12c into main Feb 19, 2026
5 checks passed
@stack72 stack72 deleted the fix/issue-triage-author-association branch February 19, 2026 20:59
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.

1 participant