-
Notifications
You must be signed in to change notification settings - Fork 24.9k
[WIP]Update issue triage workflow to use GitHub script/GitHub Models instead of github/copilot-action #36699
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 1 commit
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 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -40,6 +40,7 @@ jobs: | |||||||||
| issues: write | ||||||||||
| contents: read | ||||||||||
| pull-requests: read | ||||||||||
|
|
||||||||||
| steps: | ||||||||||
| # ========================================================================= | ||||||||||
| # STEP 1: POST WELCOME MESSAGE | ||||||||||
|
|
@@ -73,14 +74,47 @@ jobs: | |||||||||
| # - Post the analysis as a comment on the issue | ||||||||||
| # ========================================================================= | ||||||||||
| - name: Run Copilot Issue Triage | ||||||||||
| uses: github/copilot-action@v1 | ||||||||||
| uses: actions/github-script@v7 | ||||||||||
| with: | ||||||||||
| agent: .github/agents/issue-triage-nonblazor.agent.md | ||||||||||
| prompt: | | ||||||||||
| Analyze issue #${{ github.event.issue.number }} and post your triage report as a comment on the issue. | ||||||||||
| Issue URL: ${{ github.event.issue.html_url }} | ||||||||||
| env: | ||||||||||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||||
| script: | | ||||||||||
| const fs = require('fs'); | ||||||||||
|
|
||||||||||
| // Load the existing Copilot agent instructions | ||||||||||
| const agentInstructions = fs.readFileSync('.github/agents/issue-triage-nonblazor.agent.md', 'utf8'); | ||||||||||
|
|
||||||||||
| const issue = context.payload.issue; | ||||||||||
|
|
||||||||||
| // Combine instructions and issue details into one string | ||||||||||
| const promptLines = [ | ||||||||||
| agentInstructions, | ||||||||||
| '', | ||||||||||
| `Analyze issue #${issue.number} and post your triage report as a comment on the issue.`, | ||||||||||
| `Issue URL: ${issue.html_url}`, | ||||||||||
| '', | ||||||||||
| 'Title:', | ||||||||||
| issue.title, | ||||||||||
| '', | ||||||||||
| 'Body:', | ||||||||||
| issue.body | ||||||||||
|
||||||||||
| ]; | ||||||||||
|
|
||||||||||
| const prompt = promptLines.join('\n'); | ||||||||||
|
|
||||||||||
| // Invoke GitHub Models | ||||||||||
| const response = await github.rest.models.runInference({ | ||||||||||
|
Comment on lines
+103
to
+104
|
||||||||||
| // Invoke GitHub Models | |
| const response = await github.rest.models.runInference({ | |
| // Invoke GitHub Models via the generic Octokit request API | |
| const response = await github.request('POST /models/{model}/inference', { |
wadepickett marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Copilot
AI
Jan 28, 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.
There is no error handling for the AI inference API call or the file read operation. If the GitHub Models API call fails, the file doesn't exist, or the response is malformed, the workflow will fail without providing helpful error messages. Consider wrapping these operations in try-catch blocks to handle failures gracefully and provide informative error messages.
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.
@copilot open a new pull request to apply changes based on this feedback
Uh oh!
There was an error while loading. Please reload this page.