Skip to content

Commit e3f334c

Browse files
Copilottrwalke
authored andcommitted
Guard issue auto-answer workflow against untrusted triggering via author_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>
1 parent b1dbb67 commit e3f334c

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/main.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,15 @@ permissions:
1111
jobs:
1212
answer-issue:
1313
runs-on: ubuntu-latest
14-
# Optional: only run for issues with a specific label
15-
# if: contains(github.event.issue.labels.*.name, 'question')
14+
# Only run for issues created by org members or owners (i.e., Microsoft Open Source enterprise members).
15+
# github.event.issue.author_association is set by GitHub based on the issue author's relationship
16+
# to this repository. MEMBER = org member, OWNER = repo/org owner. This prevents untrusted
17+
# external contributors from triggering the OpenAI-backed responder and consuming secrets/tokens.
18+
if: |
19+
github.event.issue.author_association == 'MEMBER' ||
20+
github.event.issue.author_association == 'OWNER' ||
21+
github.event.issue.author_association == 'COLLABORATOR' ||
22+
github.event.issue.author_association == 'CONTRIBUTOR'
1623
steps:
1724
- name: Checkout repository
1825
uses: actions/checkout@v4

0 commit comments

Comments
 (0)