From a4e7e8bd5cdc90cc682a58b33c022d1bc6aa8dd2 Mon Sep 17 00:00:00 2001 From: menzel Date: Fri, 3 Jul 2026 14:28:39 +0200 Subject: [PATCH] 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) --- .gitea/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 3a742db..554e591 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -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 -- 2.54.0