Skip to content

Commit

Permalink
refactor: revert back to fetch-depth: 0
Browse files Browse the repository at this point in the history
  • Loading branch information
McPatate committed Jun 17, 2024
1 parent 40c4ff6 commit e54f8aa
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions .github/workflows/trufflehog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,16 @@ name: Secret Leaks
on:
push:

permissions:
contents: read

jobs:
trufflehog:
runs-on: ubuntu-latest
steps:
- shell: bash
env:
JSON_STRING: ${{ toJson(github.event.commits) }}
run: |
if [ "${{ github.event_name }}" == "push" ]; then
printf '%s\n' "$JSON_STRING" > commit_info.json
echo "depth=$(($(jq length < commit_info.json) + 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}}
- name: Secret Scanning
uses: trufflesecurity/trufflehog@main
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Secret Scanning
uses: trufflesecurity/trufflehog@main

0 comments on commit e54f8aa

Please sign in to comment.