Skip to content

ci: fix checkout for fork pull requests in pre-commit workflow#288

Open
l50 wants to merge 1 commit into
dreadnode:mainfrom
l50:fix/pre-commit-fork-pr-checkout
Open

ci: fix checkout for fork pull requests in pre-commit workflow#288
l50 wants to merge 1 commit into
dreadnode:mainfrom
l50:fix/pre-commit-fork-pr-checkout

Conversation

@l50

@l50 l50 commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Key Changes:

Changed:

  • Checkout step configuration
    • Added repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} alongside the existing ref parameter in .github/workflows/pre-commit.yaml so the action targets the fork's repository when checking out a PR branch, preventing a checkout failure caused by the head ref not existing on the base repo

**Changed:**

- Added `repository` input to the checkout step so fork PRs resolve the head branch from the fork's repo rather than the base repo, preventing checkout failures when the branch doesn't exist on the base repository
@l50

l50 commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

@mkultraWasHere - fixes GHA runs for external PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/github Changes made to github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pre-commit.yaml fails checkout on fork PRs (ref set, repository defaults to base repo)

1 participant