Skip to content

Commit 9d68c67

Browse files
authored
ci: shallow checkout OpenGrep PR scan
1 parent 9f0bf1c commit 9d68c67

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

.github/workflows/opengrep-precise.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
pull_request:
1212
types: [opened, synchronize, reopened, ready_for_review]
1313
paths:
14+
- ".github/actions/ensure-base-commit/**"
1415
- ".github/workflows/opengrep-precise.yml"
1516
- ".github/workflows/opengrep-precise-full.yml"
1617
- ".semgrepignore"
@@ -42,9 +43,17 @@ jobs:
4243
- name: Checkout
4344
uses: actions/checkout@v6
4445
with:
46+
ref: ${{ github.sha }}
47+
fetch-depth: 1
48+
fetch-tags: false
4549
persist-credentials: false
46-
# `scripts/run-opengrep.sh --changed` diffs base...HEAD.
47-
fetch-depth: 0
50+
submodules: false
51+
52+
- name: Ensure PR base commit
53+
uses: ./.github/actions/ensure-base-commit
54+
with:
55+
base-sha: ${{ github.event.pull_request.base.sha }}
56+
fetch-ref: ${{ github.event.pull_request.base.ref }}
4857

4958
- name: Install opengrep
5059
env:

0 commit comments

Comments
 (0)