"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "370be9cc381bbd0014916115a818448bb082ff4c"
Unverified Commit 084b5094 authored by Luc Georges's avatar Luc Georges Committed by GitHub
Browse files

feat(ci): set `fetch-depth: 0` in trufflehog checkout step (#31663)

parent 20528f06
...@@ -10,20 +10,9 @@ jobs: ...@@ -10,20 +10,9 @@ jobs:
trufflehog: trufflehog:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- shell: bash - name: Checkout code
run: | uses: actions/checkout@v4
if [ "${{ github.event_name }}" == "push" ]; then with:
echo "depth=$(($(jq length <<< '${{ toJson(github.event.commits) }}') + 2))" >> $GITHUB_ENV fetch-depth: 0
echo "branch=${{ github.ref_name }}" >> $GITHUB_ENV - name: Secret Scanning
fi uses: trufflesecurity/trufflehog@main
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment