Skip to content

How to create PRs in multiple repos from a single workflow? #18329

@tore-unumed

Description

@tore-unumed

Context

We have an agentic workflow that coordinates changes across two private repos (org/repo-a and org/repo-b). The workflow checks out both repos into subdirectories and instructs the agent to implement changes in both, then create a PR for each.

What we tried

steps:
  - uses: actions/checkout@v6          # agentic-workflows (workflow repo)
  - uses: actions/checkout@v6
    with:
      repository: org/repo-a
      path: repos/repo-a
      token: ${{ secrets.CROSS_REPO_PAT }}
  - uses: actions/checkout@v6
    with:
      repository: org/repo-b
      path: repos/repo-b
      token: ${{ secrets.CROSS_REPO_PAT }}

safe-outputs:
  github-token: ${{ secrets.CROSS_REPO_PAT }}
  create-pull-request:
    max: 2
    base-branch: main
    allowed-repos: ["org/repo-a", "org/repo-b"]

The agent successfully:

  1. Edits files in repos/repo-a/ and repos/repo-b/
  2. Creates branches and commits in each subdirectory repo
  3. Calls create_pull_request with repo: "org/repo-a" (and repo-b)

But create_pull_request returns:

No changes to commit - no commits found

Root cause (our understanding)

The safe-outputs MCP server appears to capture patches only from the workspace root .git. When target repos are checked out to subdirectories (repos/repo-a/), the MCP server does not find their commits. The safe_outputs handler job also only checks out a single repo at the workspace root.

What works

A hub-and-spokes pattern: an orchestrator plans, then dispatches a separate repo-issue-worker workflow per repo. Each worker checks out its single target repo at the workspace root — create_pull_request with target-repo works perfectly there.

Questions

  1. Is there a supported way to create PRs in multiple repos from a single workflow run? The allowed-repos config compiles successfully but does not seem to work at runtime with subdirectory checkouts.
  2. Is the hub-and-spokes pattern (orchestrator + per-repo workers via dispatch-workflow) the intended approach for multi-repo changes?
  3. Are there plans to support patch capture from non-root git repositories (e.g., by using the repo parameter to locate the correct .git directory)?

Environment

  • gh aw CLI: v0.50.2
  • GitHub MCP Server: v0.31.0
  • MCP Gateway: v0.1.5

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions