Skip to content

Conversation

@wadepickett
Copy link
Contributor

@wadepickett wadepickett commented Jan 28, 2026

Replaced Copilot action with GitHub script to analyze issues and post triage reports using GitHub Models. github/copilot-action would not work since it is not available through a workflow.

Using github/copilot-action was resulting in the following error:
Unable to resolve action github/copilot-action, repository not found


Internal previews

📄 File 🔗 Preview link
.github/workflows/issue-processing-ai-triage-nonblazor.yml =============================================================================

Replaced Copilot action with GitHub script to analyze issues and post triage reports using GitHub Models.  github/copilot-action would not work since it is not available through a workflow.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request attempts to replace the non-functional github/copilot-action with a custom GitHub script implementation that uses GitHub Models API to perform AI-powered issue triage. The workflow was failing because the github/copilot-action is not available through GitHub Actions workflows.

Changes:

  • Replaced github/copilot-action@v1 with actions/github-script@v7 for the issue triage step
  • Implemented custom JavaScript code to load agent instructions, construct a prompt, call GitHub Models API, and post the triage report
  • Maintained the existing workflow structure including welcome message, repository checkout, and label addition steps

Comment on lines +103 to +104
// Invoke GitHub Models
const response = await github.rest.models.runInference({
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GitHub REST API does not have a github.rest.models.runInference() method. GitHub Models is accessed through a different API endpoint. The correct approach would be to use the Octokit REST API client with the proper endpoint for GitHub Models, or use a direct HTTP request to the GitHub Models API.

You'll need to verify the correct API endpoint and request format for GitHub Models. As of my knowledge, GitHub Models may require using a different authentication approach and API structure.

Suggested change
// 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', {

Copilot uses AI. Check for mistakes.
Comment on lines 79 to 116
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({
model: 'gpt-4.1-mini',
input: prompt
});

const report = response.data.output_text;

await github.rest.issues.createComment({
issue_number: issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: report
});
Copy link

Copilot AI Jan 28, 2026

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

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

issue.title,
'',
'Body:',
issue.body
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue body might be null or undefined in certain edge cases. While GitHub typically provides an issue body, it's possible for issues to be created with empty bodies. Consider adding a check or default value to handle cases where 'issue.body' might be null or undefined to prevent the workflow from failing unexpectedly.

Copilot uses AI. Check for mistakes.
wadepickett and others added 2 commits January 28, 2026 11:53
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI commented Jan 28, 2026

@wadepickett I've opened a new pull request, #36702, to work on those changes. Once the pull request is ready, I'll request review from you.

@wadepickett
Copy link
Contributor Author

This is on hold for the moment and in draft. We may not have GitHub Models available to begin with. Checking on options...

@wadepickett wadepickett self-assigned this Jan 28, 2026
@wadepickett wadepickett changed the title Update issue triage workflow to use GitHub script/GitHub Models instead of github/copilot-action [WIP]Update issue triage workflow to use GitHub script/GitHub Models instead of github/copilot-action Jan 28, 2026
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