fix: fetch author_association from REST API instead of webhook payload#398
Merged
fix: fetch author_association from REST API instead of webhook payload#398
Conversation
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.
There was a problem hiding this comment.
✅ 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
- Root cause is correctly identified: GitHub webhook payloads can have stale
author_associationvalues forissues.openedevents - Fix is appropriate: Fetching via REST API allows time for GitHub to compute the correct value
- Logging addition is helpful: Will aid in debugging any future discrepancies
- Error handling: If the API call fails, the workflow will fail naturally (appropriate behavior)
The change is minimal, targeted, and solves the problem correctly.
This was referenced Feb 19, 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
needs-triageissues.openedwebhook beforeauthor_associationis fully computed, so reading it fromcontext.payload.issue.author_associationreturned a stale/incorrect valuegithub.rest.issues.get()call, which returns the correct value by the time the workflow runner executes (~6 seconds after issue creation)core.info()logging of both the webhook and REST API values so any future discrepancy is visible in run logsTest plan
needs-triagelabel and welcome comment are not addedauthor_associationvalues are logged and showMEMBER/OWNER/COLLABORATOR🤖 Generated with Claude Code