Guard issue auto-answer workflow against untrusted triggering via author_association#5841
Merged
trwalke merged 3 commits intotrwalke/addGhActionForIssuesfrom Mar 11, 2026
Merged
Conversation
Co-authored-by: trwalke <30090357+trwalke@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [WIP] Address feedback on GitHub Actions workflow for issue auto-answering
Guard issue auto-answer workflow against untrusted triggering via author_association
Mar 11, 2026
trwalke
reviewed
Mar 11, 2026
Co-authored-by: trwalke <30090357+trwalke@users.noreply.github.com>
bgavrilMS
pushed a commit
that referenced
this pull request
Mar 19, 2026
…hor_association (#5841) * Initial plan * Guard workflow against untrusted triggering using author_association Co-authored-by: trwalke <30090357+trwalke@users.noreply.github.com> * Add COLLABORATOR and CONTRIBUTOR to author_association guard Co-authored-by: trwalke <30090357+trwalke@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: trwalke <30090357+trwalke@users.noreply.github.com>
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.
The
Auto-Answer Issuesworkflow was unconditionally triggered by any public user opening an issue, causing unnecessary OpenAI API token consumption and secret exposure to untrusted actors.Changes proposed in this request
if:guard onanswer-issuejob usinggithub.event.issue.author_association, restricting execution toMEMBER,OWNER,COLLABORATOR, andCONTRIBUTORassociations onlyFIRST_TIME_CONTRIBUTOR,FIRST_TIMER,NONE) silently skip the job — no secrets are accessed, no OpenAI calls are madeMEMBERmaps to AzureAD org members (Microsoft Open Source enterprise);OWNERcovers repo/org owners;COLLABORATORcovers direct repo collaborators;CONTRIBUTORcovers users who have previously contributed to the repoTesting
No automated tests applicable for workflow YAML changes. Behavior is enforced by GitHub Actions job-level
if:evaluation before any steps execute.Performance impact
Reduces unnecessary workflow runs and OpenAI API calls triggered by untrusted external users.
Documentation
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.