Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions .github/workflows/trufflehog-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,7 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Configure Git for rename detection
run: |
git config --global diff.renames false
git config --global diff.renameLimit 0
echo "Git configured to treat renames as delete+add"

- name: Fetch PR head commits
if: github.event_name != 'workflow_dispatch'
run: |
git fetch origin +refs/pull/${{ github.event.pull_request.number }}/head:refs/remotes/origin/pr-head
echo "Fetched PR #${{ github.event.pull_request.number }} head commit: ${{ github.event.pull_request.head.sha }}"
fetch-depth: 1
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using fetch-depth: 1 with head.sha~1 as base (lines 70, 87) will fail because the parent commit won't be available in a shallow clone. Either increase fetch-depth to 2 or revert to fetching the full history to ensure the base commit is accessible for comparison.

Suggested change
fetch-depth: 1
fetch-depth: 2

Copilot uses AI. Check for mistakes.

- name: Setup exclude config
id: config
Expand All @@ -67,7 +55,7 @@ jobs:
uses: trufflesecurity/trufflehog@main
continue-on-error: true
with:
base: ${{ github.event.pull_request.base.sha }}
base: ${{ github.event.pull_request.head.sha }}~1
head: ${{ github.event.pull_request.head.sha }}
extra_args: --json ${{ steps.config.outputs.exclude_args }}

Expand All @@ -94,6 +82,7 @@ jobs:
-e GIT_CONFIG_VALUE_1=0 \
ghcr.io/trufflesecurity/trufflehog:latest \
git file:///tmp/ \
--since-commit ${{ github.event.pull_request.head.sha }}~1 \
--branch ${{ github.event.pull_request.head.sha }} \
--max-depth=1 \
--json \
Expand Down Expand Up @@ -177,6 +166,7 @@ jobs:
let body;
if (!hasSecrets) {
if (existing) {
// Update to show secrets are now resolved (whether verified or unverified)
body = `${commentMarker}
## :white_check_mark: Secret Scanning Passed
**No secrets detected in this pull request.**
Expand Down