diff --git a/.github/workflows/trufflehog.yml b/.github/workflows/trufflehog.yml index 4b5707d6a23..057a708c129 100644 --- a/.github/workflows/trufflehog.yml +++ b/.github/workflows/trufflehog.yml @@ -21,15 +21,17 @@ jobs: contents: read # clone the repo steps: + - name: Calculate fetch depth + id: fetch_depth + shell: bash + run: echo "fetch_depth=$(( ${{ github.event.pull_request.commits }} + 2 ))" >> "$GITHUB_OUTPUT" - name: Checkout code uses: actions/checkout@v4 with: persist-credentials: false - fetch-depth: 0 - ref: ${{ github.head_ref }} + fetch-depth: ${{ steps.fetch_depth.outputs.fetch_depth }} + ref: ${{ github.event.pull_request.head.ref }} - name: Trufflehog uses: trufflesecurity/trufflehog@eafb8c5f6a06175141c27f17bcc17941853d0047 # v3.90.0 with: - base: ${{ github.event.pull_request.base.sha }} - head: ${{ github.event.pull_request.head.sha }} extra_args: --results=verified