ci: fix plugin checkout for fork pull requests #245

Merged
menzel merged 1 commits from ci/fix-fork-checkout into main 2026-07-03 14:32:34 +02:00
Member

Problem: the test job's Checkout BEC Plugin Repository step pins the repository to bec/csaxs_bec and uses the head_ref context for the 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 fails with git exit code 1 (shown as Failure - Main Checkout BEC Plugin Repository) before any tests run. This makes every fork PR red regardless of its content, e.g. #243.

Fix: drop the head_ref term so the expression falls through to the sha context. 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 CI gates on the merged result. The BEC_PLUGIN_REPO_BRANCH workflow_dispatch override is unchanged.

After merge: because pull_request runs the workflow from the merged tree, existing fork PRs such as #243 need an Update Branch / re-run to regenerate the merge ref and pick up the fixed workflow.

Problem: the test job's Checkout BEC Plugin Repository step pins the repository to bec/csaxs_bec and uses the head_ref context for the 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 fails with git exit code 1 (shown as Failure - Main Checkout BEC Plugin Repository) before any tests run. This makes every fork PR red regardless of its content, e.g. #243. Fix: drop the head_ref term so the expression falls through to the sha context. 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 CI gates on the merged result. The BEC_PLUGIN_REPO_BRANCH workflow_dispatch override is unchanged. After merge: because pull_request runs the workflow from the merged tree, existing fork PRs such as #243 need an Update Branch / re-run to regenerate the merge ref and pick up the fixed workflow.
menzel added 1 commit 2026-07-03 14:30:43 +02:00
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
a4e7e8bd5c
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>
menzel merged commit a4e7e8bd5c into main 2026-07-03 14:32:34 +02:00
menzel deleted branch ci/fix-fork-checkout 2026-07-03 14:32:34 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bec/csaxs_bec#245