fix(ci): fetch PR ref on checkout instead of shallow main clone
CI & Release / Verify simulator (push) Skipped
CI & Release / Trivy scan (push) Skipped
CI & Release / Semantic Release (push) Skipped
CI & Release / Verify simulator (pull_request) Successful in 17s
CI & Release / Trivy scan (pull_request) Successful in 20s
CI & Release / Semantic Release (pull_request) Skipped

PR branches forked from main cannot checkout gitea.sha after a
depth-limited default-branch clone; fetch refs/pull/N/head instead.
This commit is contained in:
2026-07-12 12:56:06 +01:00
parent df7f38a6a5
commit 762c236310
+8 -4
View File
@@ -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: |