From 7370f48aac750def991eb0ded4b8259dc1a38928 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 16 Aug 2026 13:22:56 +0100 Subject: [PATCH] ci: clone via GITHUB_REF instead of GITHUB_REF_NAME In pull_request context, GITHUB_REF_NAME is the PR number ('17'), not the source branch. Cloning --branch 17 fails with 'Could not find remote branch 17 to clone'. Use GITHUB_REF (refs/pull/N/head in PR context, refs/heads/ in push context) and fetch + checkout FETCH_HEAD. workflow_dispatch falls back to the default branch. --- .forgejo/workflows/buildAndTest.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/buildAndTest.yml b/.forgejo/workflows/buildAndTest.yml index e0b63433..7a19e803 100644 --- a/.forgejo/workflows/buildAndTest.yml +++ b/.forgejo/workflows/buildAndTest.yml @@ -43,9 +43,12 @@ jobs: - name: Clone yavsc run: | cd "$RUNNER_WORKSPACE" - git clone --depth 1 --branch "${GITHUB_REF_NAME:-main}" \ - https://forgejo.pschneider.fr/notazof/yavsc.git _src + git clone https://forgejo.pschneider.fr/notazof/yavsc.git _src cd _src + if [ -n "${GITHUB_REF:-}" ]; then + git fetch --depth 1 origin "$GITHUB_REF" + git checkout FETCH_HEAD + fi git submodule update --init --recursive --depth 1 - name: Restore dependencies working-directory: ${{ runner.workspace }}/_src