ci: fix plugin checkout for fork pull requests
The 'Checkout BEC Plugin Repository' step pinned repository to bec/csaxs_bec with ref github.head_ref. For a pull request opened from a fork, head_ref is the fork's branch name, which does not exist in the base repo, so the checkout failed with 'git ... exit code 1' before any tests ran. Fall through to github.sha instead: on pull_request events that is the test-merge commit, which lives in the base repo, so the checkout succeeds for fork PRs and in-repo branches alike (and gates on the merged result). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit was merged in pull request #245.
This commit is contained in:
@@ -50,7 +50,11 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: bec/csaxs_bec
|
||||
ref: "${{ inputs.BEC_PLUGIN_REPO_BRANCH || github.head_ref || github.sha }}"
|
||||
# For pull_request events github.sha is the test-merge commit, which
|
||||
# lives in the base repo, so this works for fork PRs too. Using
|
||||
# github.head_ref here would try to fetch the fork's branch name from
|
||||
# bec/csaxs_bec, where it does not exist -> checkout fails (exit 1).
|
||||
ref: "${{ inputs.BEC_PLUGIN_REPO_BRANCH || github.sha }}"
|
||||
path: ./csaxs_bec
|
||||
|
||||
- name: Lint for merge conflicts from template updates
|
||||
|
||||
Reference in New Issue
Block a user