Skip to content

Commit 5836070

Browse files
ci: redistribute concurrency-cancel guard to read-only check workflows (#9)
* 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 f22f09d commit 5836070

4 files changed

Lines changed: 33 additions & 17 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 4 additions & 5 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:
@@ -30,21 +30,20 @@ jobs:
3030
fail-fast: false
3131
matrix:
3232
include:
33-
# Idris2/docs repo - no JS/TS present, scan workflows only
34-
- language: actions
33+
- language: javascript-typescript
3534
build-mode: none
3635

3736
steps:
3837
- name: Checkout
3938
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4039

4140
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@0d579ffd059c29b07949a3cce3983f0780820c98 # v3.28.1
41+
uses: github/codeql-action/init@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3
4342
with:
4443
languages: ${{ matrix.language }}
4544
build-mode: ${{ matrix.build-mode }}
4645

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

.github/workflows/scorecard-enforcer.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,42 @@ jobs:
2727
security-events: write
2828
id-token: write # For OIDC
2929
steps:
30-
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
30+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3131
with:
3232
persist-credentials: false
3333

3434
- name: Run Scorecard
35-
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
35+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
3636
with:
3737
results_file: results.sarif
3838
results_format: sarif
3939
publish_results: true
4040

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

46-
# Check specific high-priority items (separate job, allowed to have run: steps)
46+
- name: Check minimum score
47+
run: |
48+
# Parse score from results
49+
SCORE=$(jq -r '.runs[0].tool.driver.properties.score // 0' results.sarif 2>/dev/null || echo "0")
50+
51+
echo "OpenSSF Scorecard Score: $SCORE"
52+
53+
# Minimum acceptable score (0-10 scale)
54+
MIN_SCORE=5
55+
56+
if [ "$(echo "$SCORE < $MIN_SCORE" | bc -l)" = "1" ]; then
57+
echo "::error::Scorecard score $SCORE is below minimum $MIN_SCORE"
58+
exit 1
59+
fi
60+
61+
# Check specific high-priority items
4762
check-critical:
4863
runs-on: ubuntu-latest
4964
steps:
50-
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
65+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5166

5267
- name: Check SECURITY.md exists
5368
run: |

.github/workflows/scorecard.yml

Lines changed: 2 additions & 2 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:
@@ -36,6 +36,6 @@ jobs:
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: 7 additions & 5 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@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
25+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
2626
with:
2727
fetch-depth: 0 # Full history for scanning
2828

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

3436
gitleaks:
3537
runs-on: ubuntu-latest
3638
steps:
37-
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
39+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
3840
with:
3941
fetch-depth: 0
4042

@@ -47,7 +49,7 @@ jobs:
4749
rust-secrets:
4850
runs-on: ubuntu-latest
4951
steps:
50-
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
52+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
5153

5254
- name: Check for hardcoded secrets in Rust
5355
run: |

0 commit comments

Comments
 (0)