Skip to content

Commit bdc3699

Browse files
hyperpolymathclaude
andcommitted
fix(ci): remove hashFiles from job-level if in secret-scanner
hashFiles() in job-level if: caused a workflow file parse error. Move the Cargo.toml check inside the run step instead, where find can check after checkout. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 18c1d90 commit bdc3699

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/secret-scanner.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,17 @@ jobs:
3737
# Rust-specific: Check for hardcoded crypto values
3838
rust-secrets:
3939
runs-on: ubuntu-latest
40-
if: ${{ hashFiles('**/Cargo.toml') != '' }}
4140
steps:
4241
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
4342

4443
- name: Check for hardcoded secrets in Rust
4544
run: |
45+
# Skip if no Rust files
46+
if ! find . -name "Cargo.toml" -print -quit | grep -q .; then
47+
echo "No Cargo.toml found, skipping Rust secret scan"
48+
exit 0
49+
fi
50+
4651
# Patterns that suggest hardcoded secrets
4752
PATTERNS=(
4853
'const.*SECRET.*=.*"'

0 commit comments

Comments
 (0)