Skip to content

docs: remove "same-repo only" limit from push-to-pull-request-branch, document cross-repo setup#28379

Merged
pelikhan merged 2 commits intomainfrom
copilot/update-safe-outputs-docs-again
Apr 25, 2026
Merged

docs: remove "same-repo only" limit from push-to-pull-request-branch, document cross-repo setup#28379
pelikhan merged 2 commits intomainfrom
copilot/update-safe-outputs-docs-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 25, 2026

push-to-pull-request-branch now supports cross-repo usage via target-repo, but the docs still said "same-repo only". This PR updates the reference docs to reflect that and explains the checkout requirement.

Changes

  • safe-outputs.md — replace "same-repo only" with "cross-repo supported via \target-repo` when the target repository is checked out"` in the output type summary table
  • safe-outputs-pull-requests.md
    • Add target-repo and allowed-repos fields to the push-to-pull-request-branch config block
    • Add Cross-repo usage subsection documenting the mandatory path: checkout requirement and providing a minimal working example:
      checkout:
        - fetch-depth: 0
        - repository: org/target-repo
          path: ./target-repo                  # required — omitting this overwrites the source repo
          github-token: ${{ secrets.CROSS_REPO_PAT }}
          fetch: ["refs/pulls/open/*"]
      
      safe-outputs:
        github-token: ${{ secrets.CROSS_REPO_PAT }}
        push-to-pull-request-branch:
          target-repo: "org/target-repo"
          title-prefix: "[bot] "
  • cross-repository.md — add Checkout Requirement for push-to-pull-request-branch callout in the Cross-Repository Safe Outputs section, linking to the new subsection and the existing scheduled-push example

…ss-repo setup instructions

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/ae097dd6-28a0-42c5-8241-4ef1e7663220

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Copilot AI changed the title [WIP] Update safe-outputs documentation for cross-repo support docs: remove "same-repo only" limit from push-to-pull-request-branch, document cross-repo setup Apr 25, 2026
Copilot AI requested a review from gh-aw-bot April 25, 2026 01:04
@pelikhan pelikhan marked this pull request as ready for review April 25, 2026 01:09
Copilot AI review requested due to automatic review settings April 25, 2026 01:09
@pelikhan pelikhan merged commit ff5aebe into main Apr 25, 2026
3 checks passed
@pelikhan pelikhan deleted the copilot/update-safe-outputs-docs-again branch April 25, 2026 01:09
Copy link
Copy Markdown
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

Updates reference documentation to reflect that push-to-pull-request-branch supports cross-repository usage via target-repo, and documents the required checkout setup (including the path: requirement).

Changes:

  • Update safe outputs summary text to remove “same-repo only” limitation for push-to-pull-request-branch.
  • Extend push-to-pull-request-branch docs to include target-repo/allowed-repos and a new cross-repo setup section with an example.
  • Add a cross-repository docs callout describing the checkout requirement and linking to the detailed setup.
Show a summary per file
File Description
docs/src/content/docs/reference/safe-outputs.md Updates the safe output type summary to reflect cross-repo support for PR branch pushes.
docs/src/content/docs/reference/safe-outputs-pull-requests.md Documents cross-repo configuration fields and adds a “Cross-repo usage” section + example.
docs/src/content/docs/reference/cross-repository.md Adds an explicit checkout requirement callout for cross-repo PR-branch pushes and links to examples.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 3/3 changed files
  • Comments generated: 1

Comment on lines +279 to +284
- fetch-depth: 0 # checkout current (source) repo
- repository: org/target-repo
path: ./target-repo # must set path for cross-repo checkout
github-token: ${{ secrets.CROSS_REPO_PAT }}
fetch: ["refs/pulls/open/*"] # fetch all open PR branches

Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

In the cross-repo example, the org/target-repo checkout uses fetch: ["refs/pulls/open/*"] but does not set fetch-depth: 0. The checkout reference docs recommend fetch-depth: 0 when fetching additional refs to ensure full history/PR details are available; with a shallow clone the push-to-PR flow may not have enough history to inspect or apply changes reliably. Consider adding fetch-depth: 0 to the target repo checkout entry as well.

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.

[plan] Update safe-outputs docs: remove "same-repo only" and document cross-repo push_to_pull_request_branch

4 participants