From 084b5094eb490319719cc11cb05b751e0b419d49 Mon Sep 17 00:00:00 2001 From: Luc Georges Date: Tue, 30 Jul 2024 14:49:26 +0200 Subject: [PATCH] feat(ci): set `fetch-depth: 0` in trufflehog checkout step (#31663) --- .github/workflows/trufflehog.yml | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/.github/workflows/trufflehog.yml b/.github/workflows/trufflehog.yml index 7dde5462240..29a11e9354d 100644 --- a/.github/workflows/trufflehog.yml +++ b/.github/workflows/trufflehog.yml @@ -10,20 +10,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}} - - 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