Skip to content

Commit 663a8ad

Browse files
committed
ci: redistribute canonical secret-scanner.yml (concurrency-cancel guard) (Refs hyperpolymath/standards#122)
1 parent f29b4a7 commit 663a8ad

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/secret-scanner.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-License-Identifier: PMPL-1.0-or-later
1+
# SPDX-License-Identifier: PMPL-1.0
22
# Prevention workflow - scans for hardcoded secrets before they reach main
33
name: Secret Scanner
44

@@ -29,7 +29,9 @@ jobs:
2929
- name: TruffleHog Secret Scan
3030
uses: trufflesecurity/trufflehog@6c05c4a00b91aa542267d8e32a8254774799d68d # v3
3131
with:
32-
extra_args: --only-verified --fail
32+
# The v3 action injects --fail automatically on pull_request events.
33+
# Passing --fail here triggers "flag 'fail' cannot be repeated".
34+
extra_args: --only-verified
3335

3436
gitleaks:
3537
runs-on: ubuntu-latest
@@ -46,12 +48,15 @@ jobs:
4648
# Rust-specific: Check for hardcoded crypto values
4749
rust-secrets:
4850
runs-on: ubuntu-latest
49-
if: hashFiles('**/Cargo.toml') != ''
5051
steps:
5152
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
5253

5354
- name: Check for hardcoded secrets in Rust
5455
run: |
56+
if ! find . -name Cargo.toml -not -path './target/*' -print -quit | grep -q .; then
57+
echo 'No Cargo.toml found — skipping Rust secrets check'
58+
exit 0
59+
fi
5560
# Patterns that suggest hardcoded secrets
5661
PATTERNS=(
5762
'const.*SECRET.*=.*"'

0 commit comments

Comments
 (0)