MultiRepoOps
MultiRepoOps extends operational automation patterns (IssueOps, ChatOps, etc.) across multiple GitHub repositories. Using cross-repository safe outputs and secure authentication, MultiRepoOps enables coordinating work between related projects — creating tracking issues in central repos, synchronizing features to sub-repositories, and enforcing organization-wide policies — all through AI-powered workflows.
Using a Side Repository
Section titled “Using a Side Repository”A side repository is a dedicated automation repo that runs workflows targeting one or more main codebases. This keeps AI-generated issues, comments, and workflow runs isolated from your main repository — no changes needed to existing projects and no mixing of automation infrastructure with production code.
flowchart LR
subgraph side["Side repo (workflows)"]
event([Schedule / dispatch]) --> agent[AI agent]
end
agent -->|target-repo| main[Main repo]
Teams new to agentic workflows can adopt this pattern: create a private repository, add a PAT as a secret, and point target-repo at your main codebase. No changes required to the main repo.
---on: weekly on monday
safe-outputs: github-token: ${{ secrets.GH_AW_MAIN_REPO_TOKEN }} create-issue: target-repo: "my-org/main-repo" labels: [automation, weekly-check] max: 5
tools: github: github-token: ${{ secrets.GH_AW_MAIN_REPO_TOKEN }} toolsets: [repos, issues, pull_requests]---
# Weekly Repository Health Check
Analyze my-org/main-repo and create issues for stale PRs (>30 days) and failed CI runs on main.Using Slash commands from a side repo require a bridge: a thin relay workflow in the main repo listens for the command and forwards it via workflow_dispatch to the side repo. See Triage from Side Repo for a complete walkthrough.
Authentication details and step-by-step setup are covered in the Triage from Side Repo and Code Quality Monitoring examples, and in the Authentication reference.
Preparing an advisory fix
Section titled “Preparing an advisory fix”Use your personal private side repository to prepare and test fixes for unpublished advisories. GitHub does not run Actions or PR status checks in temporary private advisory forks.
- Run
gh aw advisory setuponce to create or reuse<your-login>/gh-aw-advisoriesunder the personal GitHub.com account authenticated bygh. Do not add collaborators or share logs or artifacts. Keep collaboration in the existing temporary advisory fork. Follow any upstream policy on copying private source code to a personal repository. Use manual dispatch from trusted workflow code, not a public issue or slash-command relay. - Use a target-only checkout pinned to the upstream commit you intend to patch. A shallow checkout limits history; a sparse checkout limits files in the working tree. Include the build and test dependencies in the checkout configuration so the agent does not need to fetch them later. Use read-only checkout credentials and keep advisory fork credentials out of Actions. Review the compiled jobs and exclude any maintenance or safe-output jobs that can write to the upstream repository.
- Review the fix and test results privately. Keep any patch artifact in the private side repository, use short retention, and check who can download it. Secret redaction does not remove all advisory details.
- Use the experimental
gh aw advisory record,inspect, andtransfercommands to save the exact private run and artifact IDs locally, then review and approve the patch by GHSA ID. If the advisory has no temporary private fork, add--create-forktorecordor create it in GitHub. The same side repository can hold separate runs for multiple advisories. Open the PR from the advisory in GitHub after transfer. If the base has moved, rebase and retest the fix before handing it off.
For an opt-in starting point, add "maintenance": false to the private side repository’s .github/aw.json and adapt this workflow. Replace the repository, base SHA, and sparse paths with values reviewed by the maintainers. Use the full SHA, not a dispatch input or a branch that can move.
Before dispatching, create a fine-grained token scoped to the upstream repository with Contents: Read-only, and store it as the UPSTREAM_READ_TOKEN Actions secret in the private side repository. The default GITHUB_TOKEN is scoped to the side repository and cannot read a private upstream. Set github-token on the upstream checkout, not in the agent environment. The checkout does not persist the token in Git configuration. Do not use an advisory fork credential.
---on: workflow_dispatchif: github.event.repository.private == true && github.event.repository.full_name == 'my-login/gh-aw-advisories'permissions: contents: none copilot-requests: writecheckout: - repository: my-org/upstream github-token: ${{ secrets.UPSTREAM_READ_TOKEN }} ref: "0123456789abcdef0123456789abcdef01234567" path: target fetch-depth: 1 sparse-checkout: | src/ tests/tools: github: false bash: truenetwork: allowed: []safe-outputs: report-failure-as-issue: false report-failed-jobs: false report-missing-tool: create-issue: false report-missing-data: create-issue: false report-incomplete: false noop: report-as-issue: false threat-detection: report-as-issue: false upload-artifact: retention-days: 1 max-size-bytes: 4194304 allowed-paths: - "handoff/fix.patch" - "handoff/review.txt"---
# Prepare a defensive fix
Work only in `target/`. Prepare the maintainer-approved remediation, not aproof of exploit. Stage only the intended changes and run the targeted testsfor those changes. If the required files or dependencies are unavailable,report that limitation; do not fetch additional code or broaden the checkout.
Export a text Git diff including staged new files to `handoff/fix.patch`relative to the workspace root. Diff the staged index against the pinnedcheckout commit with external diff and text conversion disabled. Beforereporting tests as passed, confirm that the tested source matches the stagedchanges and that tests did not change those sources. Record the upstreamrepository, base SHA, patch SHA-256, and the test commands and outcomes in`handoff/review.txt`. Distinguish tests that failed or were not run from teststhat passed. Ask the maintainer to review both files before transfer.Use `upload_artifact` to upload the `handoff` directory only.Use the artifact link in the run summary to identify the artifact ID and review the test notes. Artifact handoff requires a successful first attempt; start a fresh manual dispatch instead of rerunning an earlier attempt. Review the patch with gh aw advisory inspect <GHSA-ID> --print-patch in a private terminal and type yes at the prompt. Omit --print-patch for metadata and the digest in scripts or CI. Do not send the untrusted diff to agents or logs. The approval digest binds the source identity, patch bytes, and fork destination; it does not replace review or independent verification.
The generic PR transfer command is not an advisory handoff command: it can create a normal fork and open a PR. Likewise, the security advisory safe outputs target the workflow repository, not the upstream repository or its temporary private fork.
CentralRepoOps
Section titled “CentralRepoOps”For automation hosted centrally and targeting software in one or more other repositories, see CentralRepoOps. Workers can run on their own schedules; an orchestrator is optional. The central automation repository can also collect events from component repos for unified visibility.
Flowing Changes to Downstream Repositories
Section titled “Flowing Changes to Downstream Repositories”The source repository propagates changes outward to downstream repos whenever relevant paths change. The agent adapts the changes for each target’s structure and opens a pull request for review.
flowchart LR
subgraph src["Source repo"]
event([Change]) --> agent[AI agent]
end
agent -->|create-pull-request| d1[Downstream A]
agent -->|create-pull-request| d2[Downstream B]
agent -->|create-pull-request| d3[Downstream N]
Use max to control fan-out breadth, and title-prefix plus labels to make the automated PRs easy to filter. See Feature Synchronization for a complete example.
Target-Only Checkout
Section titled “Target-Only Checkout”Side repositories that only need to check out a target repository — not their own hosting repository — can set permissions.contents: none. This skips the automatic workflow-repository checkout while keeping any explicitly configured checkout: entries (like a target repo) intact:
permissions: contents: nonecheckout: - repository: octo-org/target-repository path: target github-app: client-id: ${{ vars.TARGET_APP_CLIENT_ID }} private-key: ${{ secrets.TARGET_APP_PRIVATE_KEY }}See Target-Only Checkout in the checkout reference for details.
Cross-Repository Safe Outputs
Section titled “Cross-Repository Safe Outputs”Most safe output types support target-repo to write to external repositories, and allowed-repos for dynamic multi-target workflows. See Cross-Repository Safe Outputs for the complete list and configuration options, including target-repo: "*" for runtime-determined targets and the GitHub Tools reference for reading from private repositories.
Deterministic Multi-Repo Workflows
Section titled “Deterministic Multi-Repo Workflows”For direct repository access without agent involvement, check out multiple repositories using checkout: frontmatter or actions/checkout steps. See the Deterministic Multi-Repo example in the cross-repository reference.
Best Practices
Section titled “Best Practices”Use GitHub Apps over PATs for automatic token revocation; scope tokens minimally to target repositories. Set appropriate max limits and consistent label/prefix conventions. Test against public repositories first before rolling out to private or org-wide targets.
Learn More
Section titled “Learn More”- CentralRepoOps — Central control plane and tracker repo patterns
- Cross-Repository Operations — Checkout and
target-repoconfiguration - GitHub Repository Checkout — Full checkout configuration, including target-only checkout
- Safe Outputs — Complete safe output configuration
- GitHub Tools — GitHub API toolsets
- Authentication — PAT and GitHub App setup
- Adding Existing Workflows — Sharing workflows across repos