Skip to content

Guard issue auto-answer workflow against untrusted triggering via author_association#5841

Merged
trwalke merged 3 commits intotrwalke/addGhActionForIssuesfrom
copilot/sub-pr-5836-one-more-time
Mar 11, 2026
Merged

Guard issue auto-answer workflow against untrusted triggering via author_association#5841
trwalke merged 3 commits intotrwalke/addGhActionForIssuesfrom
copilot/sub-pr-5836-one-more-time

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 11, 2026

The Auto-Answer Issues workflow 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

  • Added if: guard on answer-issue job using github.event.issue.author_association, restricting execution to MEMBER, OWNER, COLLABORATOR, and CONTRIBUTOR associations only
  • First-time contributors and fully external/anonymous users (FIRST_TIME_CONTRIBUTOR, FIRST_TIMER, NONE) silently skip the job — no secrets are accessed, no OpenAI calls are made
  • MEMBER maps to AzureAD org members (Microsoft Open Source enterprise); OWNER covers repo/org owners; COLLABORATOR covers direct repo collaborators; CONTRIBUTOR covers users who have previously contributed to the repo
if: |
  github.event.issue.author_association == 'MEMBER' ||
  github.event.issue.author_association == 'OWNER' ||
  github.event.issue.author_association == 'COLLABORATOR' ||
  github.event.issue.author_association == 'CONTRIBUTOR'

Testing
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

  • All relevant documentation is updated.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

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
Comment thread .github/workflows/main.yml Outdated
Co-authored-by: trwalke <30090357+trwalke@users.noreply.github.com>
@trwalke trwalke marked this pull request as ready for review March 11, 2026 20:52
@trwalke trwalke requested a review from a team as a code owner March 11, 2026 20:52
@trwalke trwalke merged commit 5b78449 into trwalke/addGhActionForIssues Mar 11, 2026
3 checks passed
@trwalke trwalke deleted the copilot/sub-pr-5836-one-more-time branch March 11, 2026 20:52
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>
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.

2 participants