fix: fetch PR head SHA after shallow clone in CI
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 15s
CI & Release / Semantic Release (pull_request) Skipped
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 15s
CI & Release / Semantic Release (pull_request) Skipped
Shallow clone only includes default-branch history; pull_request runs must fetch the event commit before checkout.
This commit is contained in:
@@ -25,6 +25,7 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
run: |
|
run: |
|
||||||
git clone --depth=50 https://${{ gitea.actor }}:${{ gitea.token }}@git.produktor.io/${{ gitea.repository }}.git .
|
git clone --depth=50 https://${{ gitea.actor }}:${{ gitea.token }}@git.produktor.io/${{ gitea.repository }}.git .
|
||||||
|
git fetch --depth=1 origin ${{ gitea.sha }}
|
||||||
git checkout ${{ gitea.sha }}
|
git checkout ${{ gitea.sha }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
@@ -62,6 +63,7 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
run: |
|
run: |
|
||||||
git clone --depth=1 https://${{ gitea.actor }}:${{ gitea.token }}@git.produktor.io/${{ gitea.repository }}.git .
|
git clone --depth=1 https://${{ gitea.actor }}:${{ gitea.token }}@git.produktor.io/${{ gitea.repository }}.git .
|
||||||
|
git fetch --depth=1 origin ${{ gitea.sha }}
|
||||||
git checkout ${{ gitea.sha }}
|
git checkout ${{ gitea.sha }}
|
||||||
|
|
||||||
- name: Install Trivy
|
- name: Install Trivy
|
||||||
|
|||||||
Reference in New Issue
Block a user