Skip to content

Commit

Permalink
feat(ci): set fetch-depth: 0 in trufflehog checkout step (#79)
Browse files Browse the repository at this point in the history
This should prevent the issues happening randomly on some commits when
bash was having issues escaping some characters.
  • Loading branch information
tengomucho authored Jul 24, 2024
1 parent 7f5b0cc commit 6eb9146
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/secrets-leak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,9 @@ jobs:
trufflehog:
runs-on: ubuntu-latest
steps:
- shell: bash
run: |
if [ "${{ github.event_name }}" == "push" ]; then
echo "depth=$(($(jq length <<< '${{ toJson(github.event.commits) }}') + 2))" >> $GITHUB_ENV
echo "branch=${{ github.ref_name }}" >> $GITHUB_ENV
fi
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "depth=$((${{ github.event.pull_request.commits }}+2))" >> $GITHUB_ENV
echo "branch=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
fi
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{env.branch}}
fetch-depth: ${{env.depth}}
fetch-depth: 0
- name: Secret Scanning
uses: trufflesecurity/trufflehog@main

0 comments on commit 6eb9146

Please sign in to comment.