ci: fix plugin checkout for fork pull requests
CI for csaxs_bec / test (pull_request) Successful in 1m30s
Read the Docs Deploy Trigger / trigger-rtd-webhook (push) Successful in 2s
CI for csaxs_bec / test (push) Successful in 1m34s

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:
2026-07-03 14:28:39 +02:00
co-authored by Claude Opus 4.8
parent a964d27234
commit a4e7e8bd5c
+5 -1
View File
@@ -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