Skip to content

Add cross-repo issue analysis agentic workflow#670

Merged
patniko merged 2 commits intomainfrom
cross-repo-issue-analysis
Mar 5, 2026
Merged

Add cross-repo issue analysis agentic workflow#670
patniko merged 2 commits intomainfrom
cross-repo-issue-analysis

Conversation

@patniko
Copy link
Contributor

@patniko patniko commented Mar 5, 2026

Adds an agentic workflow that analyzes issues filed in copilot-sdk to determine if the root cause is in copilot-agent-runtime. When a runtime fix is needed, it automatically creates a linked issue and draft PR in the runtime repo.

Triggers on new issues and manual workflow_dispatch. Requires a CROSS_REPO_PAT secret with access to both repos.

Adds an agentic workflow that analyzes issues filed in copilot-sdk to
determine if the root cause is in copilot-agent-runtime. When a runtime
fix is needed, it automatically creates a linked issue and draft PR in
the runtime repo.

Triggers on new issues and manual workflow_dispatch. Requires a
CROSS_REPO_PAT secret with access to both repos.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@patniko patniko requested a review from a team as a code owner March 5, 2026 00:29
Copilot AI review requested due to automatic review settings March 5, 2026 00:29
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@patniko patniko enabled auto-merge March 5, 2026 00:31
@patniko patniko disabled auto-merge March 5, 2026 00:34
@patniko patniko merged commit ee18f6e into main Mar 5, 2026
10 checks passed
@patniko patniko deleted the cross-repo-issue-analysis branch March 5, 2026 00:34
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

Adds a new agentic GitHub workflow to triage/copilot-sdk issues and, when appropriate, open linked tracking artifacts (issue + draft PR) in github/copilot-agent-runtime using a cross-repo PAT.

Changes:

  • Introduces cross-repo-issue-analysis.md agent prompt/workflow definition for analyzing SDK issues vs runtime root causes.
  • Adds the compiled cross-repo-issue-analysis.lock.yml workflow for CI execution.
  • Updates .github/aw/actions-lock.json to pin github/gh-aw/actions/setup@v0.50.5 used by the new lock workflow.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/cross-repo-issue-analysis.md Defines the agent’s tasking/prompt + safe-outputs constraints for cross-repo issue/PR creation.
.github/workflows/cross-repo-issue-analysis.lock.yml Compiled workflow that runs the agent and safe-outputs handler in CI.
.github/aw/actions-lock.json Adds the pinned action version required by the new compiled workflow.

id: validate-secret
run: /opt/gh-aw/actions/validate_multi_secret.sh COPILOT_GITHUB_TOKEN 'GitHub Copilot CLI' https://github.github.com/gh-aw/reference/engines/#github-copilot-default
env:
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

The workflow validates COPILOT_GITHUB_TOKEN early, but never validates CROSS_REPO_PAT even though it’s required for safe-outputs and cross-repo operations. If the secret is missing/invalid the run will fail later with a less actionable error; add an early validation step for CROSS_REPO_PAT similar to the existing validate_multi_secret.sh check.

Suggested change
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
- name: Validate CROSS_REPO_PAT secret
run: /opt/gh-aw/actions/validate_multi_secret.sh CROSS_REPO_PAT 'Cross-Repo PAT' https://github.github.com/gh-aw/reference/engines/#github-copilot-default
env:
CROSS_REPO_PAT: ${{ secrets.CROSS_REPO_PAT }}

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +15
---
description: Analyzes copilot-sdk issues to determine if a fix is needed in copilot-agent-runtime, then opens a linked issue and suggested-fix PR there
on:
issues:
types: [opened]
workflow_dispatch:
inputs:
issue_number:
description: "Issue number to analyze"
required: true
type: string
permissions:
contents: read
issues: read
pull-requests: read
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

The compiled lock workflow includes a pre-activation gate (admin/maintainer/write) because this workflow uses CROSS_REPO_PAT, but the source .md doesn’t declare any roles:. Please add an explicit roles: entry (and/or mention the restriction in the workflow description) so it’s clear who can trigger runs and why runs on externally-filed issues won’t activate.

Copilot uses AI. Check for mistakes.
permissions: {}

concurrency:
group: "gh-aw-${{ github.workflow }}-${{ github.event.issue.number }}"
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

concurrency.group is based only on github.event.issue.number, which is empty for workflow_dispatch. That means manual runs (even for different issue numbers) will share the same concurrency group and cancel/serialize each other unexpectedly. Consider including inputs.issue_number (or github.run_id as a fallback) in the group key.

Suggested change
group: "gh-aw-${{ github.workflow }}-${{ github.event.issue.number }}"
group: "gh-aw-${{ github.workflow }}-${{ github.event.issue.number || inputs.issue_number || github.run_id }}"

Copilot uses AI. Check for mistakes.
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