Skip to content

Commit 1bc70ac

Browse files
authored
refactor: revert back to fetch-depth: 0 (#755)
1 parent 40c4ff6 commit 1bc70ac

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

.github/workflows/trufflehog.yml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,16 @@ name: Secret Leaks
33
on:
44
push:
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
trufflehog:
811
runs-on: ubuntu-latest
912
steps:
10-
- shell: bash
11-
env:
12-
JSON_STRING: ${{ toJson(github.event.commits) }}
13-
run: |
14-
if [ "${{ github.event_name }}" == "push" ]; then
15-
printf '%s\n' "$JSON_STRING" > commit_info.json
16-
echo "depth=$(($(jq length < commit_info.json) + 2))" >> $GITHUB_ENV
17-
echo "branch=${{ github.ref_name }}" >> $GITHUB_ENV
18-
fi
19-
if [ "${{ github.event_name }}" == "pull_request" ]; then
20-
echo "depth=$((${{ github.event.pull_request.commits }}+2))" >> $GITHUB_ENV
21-
echo "branch=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
22-
fi
2313
- name: Checkout code
2414
uses: actions/checkout@v4
2515
with:
26-
ref: ${{env.branch}}
27-
fetch-depth: ${{env.depth}}
16+
fetch-depth: 0
2817
- name: Secret Scanning
2918
uses: trufflesecurity/trufflehog@main

0 commit comments

Comments
 (0)