Skip to content

Commit 8ba9512

Browse files
committed
ci: redistribute canonical secret-scanner.yml (concurrency-cancel guard) (Refs hyperpolymath/standards#122)
1 parent 0ebc693 commit 8ba9512

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

.github/workflows/secret-scanner.yml

Lines changed: 13 additions & 10 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

@@ -7,6 +7,14 @@ on:
77
push:
88
branches: [main]
99

10+
# Estate guardrail: cancel superseded runs so re-pushes / rebased PR
11+
# updates do not pile up queued runs against the shared account-wide
12+
# Actions concurrency pool. Applied only to read-only check workflows
13+
# (no publish/mutation), so cancelling a superseded run is always safe.
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
1018
permissions:
1119
contents: read
1220

@@ -21,6 +29,8 @@ jobs:
2129
- name: TruffleHog Secret Scan
2230
uses: trufflesecurity/trufflehog@6c05c4a00b91aa542267d8e32a8254774799d68d # v3
2331
with:
32+
# The v3 action injects --fail automatically on pull_request events.
33+
# Passing --fail here triggers "flag 'fail' cannot be repeated".
2434
extra_args: --only-verified
2535

2636
gitleaks:
@@ -43,12 +53,10 @@ jobs:
4353

4454
- name: Check for hardcoded secrets in Rust
4555
run: |
46-
# Skip if no Rust files
47-
if ! find . -name "Cargo.toml" -print -quit | grep -q .; then
48-
echo "No Cargo.toml found, skipping Rust secret scan"
56+
if ! find . -name Cargo.toml -not -path './target/*' -print -quit | grep -q .; then
57+
echo 'No Cargo.toml found — skipping Rust secrets check'
4958
exit 0
5059
fi
51-
5260
# Patterns that suggest hardcoded secrets
5361
PATTERNS=(
5462
'const.*SECRET.*=.*"'
@@ -71,8 +79,3 @@ jobs:
7179
echo "::error::Potential hardcoded secrets detected. Use environment variables instead."
7280
exit 1
7381
fi
74-
75-
- name: K9-SVC Validation
76-
run: |
77-
echo "K9-SVC validation"
78-
[ -d .machine_readable/contractiles ] && echo "Contractiles present" || echo "No contractiles"

0 commit comments

Comments
 (0)