From 762c23631052f6c7463e0aca3e8acc188e586352 Mon Sep 17 00:00:00 2001 From: Andriy Oblivantsev Date: Sun, 12 Jul 2026 12:56:06 +0100 Subject: [PATCH] fix(ci): fetch PR ref on checkout instead of shallow main clone PR branches forked from main cannot checkout gitea.sha after a depth-limited default-branch clone; fetch refs/pull/N/head instead. --- .github/workflows/release.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ba20cd3..e704cb2 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -24,8 +24,10 @@ jobs: steps: - name: Checkout run: | - git clone --depth=50 https://${{ gitea.actor }}:${{ gitea.token }}@git.produktor.io/${{ gitea.repository }}.git . - git checkout ${{ gitea.sha }} + git init . + git remote add origin https://${{ gitea.actor }}:${{ gitea.token }}@git.produktor.io/${{ gitea.repository }}.git + git fetch --depth=50 origin "${{ gitea.ref }}" + git checkout FETCH_HEAD - name: Install dependencies run: pip install --quiet -r simulator/requirements.txt @@ -61,8 +63,10 @@ jobs: steps: - name: Checkout run: | - git clone --depth=1 https://${{ gitea.actor }}:${{ gitea.token }}@git.produktor.io/${{ gitea.repository }}.git . - git checkout ${{ gitea.sha }} + git init . + git remote add origin https://${{ gitea.actor }}:${{ gitea.token }}@git.produktor.io/${{ gitea.repository }}.git + git fetch --depth=1 origin "${{ gitea.ref }}" + git checkout FETCH_HEAD - name: Install Trivy run: |