Skip to content

fix: use GitHub Copilot CLI for AI PR summaries instead of GitHub Models API#2

Closed
Copilot wants to merge 2 commits intodevelopfrom
copilot/fix-ai-summary-error
Closed

fix: use GitHub Copilot CLI for AI PR summaries instead of GitHub Models API#2
Copilot wants to merge 2 commits intodevelopfrom
copilot/fix-ai-summary-error

Conversation

Copy link

Copilot AI commented Mar 23, 2026

The AI PR summary step was calling the GitHub Models API directly, which responded with 400 and silently skipped the summary. Replaced with GitHub Copilot CLI (@github/copilot) per the official Actions integration docs.

Changes

  • New reusable workflow .github/workflows/ai-pr-summary.yml (workflow_call)
    • Installs @github/copilot CLI (Node 20)
    • Authenticates via COPILOT_GITHUB_TOKEN (PAT with "Copilot Requests" permission, passed as COPILOT_TOKEN secret)
    • Fetches PR diff → asks Copilot CLI to summarize → posts result as a PR comment
    • Fails fast with a clear error if the diff is empty or summary.md is not produced

Usage from monorepo (or any repo)

jobs:
  summarize:
    uses: webmonitoring/.github/.github/workflows/ai-pr-summary.yml@develop
    with:
      pr_number: ${{ github.event.pull_request.number }}
    secrets:
      COPILOT_TOKEN: ${{ secrets.COPILOT_TOKEN }}

Prerequisite: Create a fine-grained PAT with the Copilot Requests permission and store it as the COPILOT_TOKEN Actions secret in the calling repository.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix AI summary error in GitHub Models API fix: use GitHub Copilot CLI for AI PR summaries instead of GitHub Models API Mar 23, 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