Skip to content

Commit 529e8f5

Browse files
ci: redistribute concurrency-cancel guard to read-only check workflows (#10)
* ci: redistribute canonical codeql.yml (concurrency-cancel guard) (Refs hyperpolymath/standards#122) * ci: redistribute canonical governance.yml (concurrency-cancel guard) (Refs hyperpolymath/standards#122) * ci: redistribute canonical scorecard-enforcer.yml (concurrency-cancel guard) (Refs hyperpolymath/standards#122) * ci: redistribute canonical scorecard.yml (concurrency-cancel guard) (Refs hyperpolymath/standards#122) * ci: redistribute canonical secret-scanner.yml (concurrency-cancel guard) (Refs hyperpolymath/standards#122)
1 parent 4e5a27a commit 529e8f5

4 files changed

Lines changed: 20 additions & 30 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 3 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
name: CodeQL Security Analysis
33

44
on:
@@ -38,12 +38,12 @@ jobs:
3838
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3939

4040
- name: Initialize CodeQL
41-
uses: github/codeql-action/init@0d579ffd059c29b07949a3cce3983f0780820c98 # v3.28.1
41+
uses: github/codeql-action/init@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3
4242
with:
4343
languages: ${{ matrix.language }}
4444
build-mode: ${{ matrix.build-mode }}
4545

4646
- name: Perform CodeQL Analysis
47-
uses: github/codeql-action/analyze@0d579ffd059c29b07949a3cce3983f0780820c98 # v3.28.1
47+
uses: github/codeql-action/analyze@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3
4848
with:
4949
category: "/language:${{ matrix.language }}"

.github/workflows/scorecard-enforcer.yml

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ jobs:
3636
with:
3737
results_file: results.sarif
3838
results_format: sarif
39-
publish_results: false
39+
publish_results: true
4040

4141
- name: Upload SARIF
42-
uses: github/codeql-action/upload-sarif@0d579ffd059c29b07949a3cce3983f0780820c98 # v4
42+
uses: github/codeql-action/upload-sarif@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v4
4343
with:
4444
sarif_file: results.sarif
4545

@@ -71,26 +71,11 @@ jobs:
7171
exit 1
7272
fi
7373
74-
- name: Check LICENSE exists
75-
run: |
76-
if [ ! -f "LICENSE" ] && [ ! -f "LICENSE.txt" ] && [ ! -f "LICENSE.md" ]; then
77-
echo "::error::LICENSE file is required for OpenSSF Best Practices"
78-
exit 1
79-
fi
80-
81-
- name: Check CONTRIBUTING exists
82-
run: |
83-
if [ ! -f "CONTRIBUTING.md" ] && [ ! -f "CONTRIBUTING.adoc" ]; then
84-
echo "::error::CONTRIBUTING file is required for OpenSSF Best Practices"
85-
exit 1
86-
fi
87-
8874
- name: Check for pinned dependencies
8975
run: |
9076
# Check workflows for unpinned actions
9177
unpinned=$(grep -r "uses:.*@v[0-9]" .github/workflows/*.yml 2>/dev/null | grep -v "#" | head -5 || true)
9278
if [ -n "$unpinned" ]; then
93-
echo "::error::Found unpinned actions — all actions MUST be SHA-pinned:"
79+
echo "::warning::Found unpinned actions:"
9480
echo "$unpinned"
95-
exit 1
9681
fi

.github/workflows/scorecard.yml

Lines changed: 3 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
name: OSSF Scorecard
33
on:
44
push:
@@ -30,12 +30,12 @@ jobs:
3030
persist-credentials: false
3131

3232
- name: Run Scorecard
33-
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
33+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.3.1
3434
with:
3535
results_file: results.sarif
3636
results_format: sarif
3737

3838
- name: Upload results
39-
uses: github/codeql-action/upload-sarif@0d579ffd059c29b07949a3cce3983f0780820c98 # v3.31.8
39+
uses: github/codeql-action/upload-sarif@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3.31.8
4040
with:
4141
sarif_file: results.sarif

.github/workflows/secret-scanner.yml

Lines changed: 11 additions & 6 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

@@ -22,19 +22,21 @@ jobs:
2222
trufflehog:
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
25+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
2626
with:
2727
fetch-depth: 0 # Full history for scanning
2828

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
3638
steps:
37-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
39+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
3840
with:
3941
fetch-depth: 0
4042

@@ -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:
51-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
52+
- 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)