Skip to content

Harden run-doctools PR checkout and push behavior - #1248

Closed
sei-vsarvepalli with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-run-doctools-job
Closed

sei-vsarvepalli with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-run-doctools-job

Conversation

Copilot AI commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Description

run-doctools was failing before doctools ran because the workflow checked out github.head_ref, which breaks on reruns once the PR branch name is no longer resolvable on origin. This change makes the job execute against the PR source repository at the immutable head SHA and keeps the data regeneration push path safe.

Changes

  • Checkout source revision

    • switch checkout to the PR source repo:
      • ${{ github.event.pull_request.head.repo.full_name }}
    • check out the immutable PR head commit:
      • ${{ github.event.pull_request.head.sha }}
  • Pin workflow dependency

    • replace actions/checkout@v7 with the current v7 commit SHA to avoid tag drift
  • Make auto-push resilient

    • push from detached HEAD explicitly to the PR branch:
      • git push origin HEAD:${{ github.head_ref }}
    • skip the commit/push step if the PR branch no longer exists remotely

Example

- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
  with:
    repository: ${{ github.event.pull_request.head.repo.full_name }}
    ref: ${{ github.event.pull_request.head.sha }}
    fetch-depth: 0

Co-authored-by: sei-vsarvepalli <19911912+sei-vsarvepalli@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job run-doctools Harden run-doctools PR checkout and push behavior Sep 16, 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