-
Notifications
You must be signed in to change notification settings - Fork 400
Add GitHub Actions workflow for auto-answering issues #5836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
b1dbb67
e3f334c
ecb3764
3262c08
f313786
26ca746
d0372a7
52a3945
ed76c68
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,151 @@ | ||||||||||||||||||
| name: Auto-Answer Issues | ||||||||||||||||||
|
|
||||||||||||||||||
| on: | ||||||||||||||||||
| issues: | ||||||||||||||||||
| types: [opened, labeled] | ||||||||||||||||||
|
|
||||||||||||||||||
trwalke marked this conversation as resolved.
Show resolved
Hide resolved
trwalke marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
| permissions: | ||||||||||||||||||
| issues: write | ||||||||||||||||||
| contents: read | ||||||||||||||||||
|
Comment on lines
+7
to
+9
|
||||||||||||||||||
|
|
||||||||||||||||||
| jobs: | ||||||||||||||||||
| answer-issue: | ||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||
| # Only run for issues created by org members or owners (i.e., Microsoft Open Source enterprise members). | ||||||||||||||||||
| # github.event.issue.author_association is set by GitHub based on the issue author's relationship | ||||||||||||||||||
| # to this repository. MEMBER = org member, OWNER = repo/org owner. This prevents untrusted | ||||||||||||||||||
| # external contributors from triggering the Azure OpenAI-backed responder and consuming secrets/tokens. | ||||||||||||||||||
|
Comment on lines
+14
to
+17
|
||||||||||||||||||
| # Only run for issues created by org members or owners (i.e., Microsoft Open Source enterprise members). | |
| # github.event.issue.author_association is set by GitHub based on the issue author's relationship | |
| # to this repository. MEMBER = org member, OWNER = repo/org owner. This prevents untrusted | |
| # external contributors from triggering the Azure OpenAI-backed responder and consuming secrets/tokens. | |
| # Only run for issues created by users who have a trusted relationship to this repo/org in GitHub | |
| # (based on github.event.issue.author_association), such as MEMBER, OWNER, or COLLABORATOR. | |
| # author_association reflects the issue author's relationship to this repository/organization only; | |
| # it does NOT indicate GitHub Enterprise or "Microsoft Open Source enterprise" membership. |
Copilot
AI
Apr 1, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The explanatory comment says “Only run for issues created by org members or owners”, but the if: condition also allows COLLABORATOR. Either update the comment to include collaborators, or tighten the condition to match the stated restriction.
Copilot
AI
Apr 1, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR description says the automation is restricted to “members, owners, collaborators, and contributors”, but the workflow guard currently does not include CONTRIBUTOR. Either update the PR description to match the implementation, or add CONTRIBUTOR back if it’s intended to be allowed.
Copilot
AI
Mar 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The actions/checkout step is not used by subsequent steps (the script is inline and dependencies are installed from the registry). Removing checkout reduces runtime and avoids granting/using repository content access unnecessarily.
| - name: Checkout repository | |
| uses: actions/checkout@v4 |
trwalke marked this conversation as resolved.
Show resolved
Hide resolved
trwalke marked this conversation as resolved.
Show resolved
Hide resolved
trwalke marked this conversation as resolved.
Show resolved
Hide resolved
Copilot
AI
Mar 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This prompt hard-codes “An issue has been opened…”, but the workflow also runs on the labeled event. Consider adjusting the prompt text based on github.event.action so the model has accurate context (e.g., “opened” vs “labeled for auto-answer”).
Copilot
AI
Apr 1, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The duplicate-response check treats any existing comment by github-actions[bot] as “already answered”. That’s overly broad (other workflows/actions can comment as github-actions[bot]) and can prevent this workflow from ever posting. Consider adding a unique marker to this workflow’s comment (e.g., an HTML comment tag) and checking for that marker instead.
Copilot
AI
Mar 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This workflow always posts a new comment for every eligible opened/labeled event. There’s currently no guard for a specific label name and no check for whether the bot has already commented, so repeated labeling (or reopening) can spam issues and burn Azure OpenAI tokens. Consider (a) gating on a dedicated label (e.g. only when action == 'labeled' && label.name == 'auto-answer'), and/or (b) listing existing issue comments via Octokit and exiting early if a prior auto-answer marker/comment from the bot is already present.
Uh oh!
There was an error while loading. Please reload this page.