Skip to content

Commit b5f32d6

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

4 files changed

Lines changed: 29 additions & 50 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 10 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
# SPDX-License-Identifier: PMPL-1.0-or-later
2-
# RSR-compliant CodeQL workflow with SHA-pinned actions
3-
4-
name: "CodeQL"
1+
# SPDX-License-Identifier: PMPL-1.0
2+
name: CodeQL Security Analysis
53

64
on:
75
push:
8-
branches: ["main"]
6+
branches: [main, master]
97
pull_request:
10-
branches: ["main"]
8+
branches: [main, master]
119
schedule:
12-
- cron: '42 20 * * 0'
10+
- cron: '0 6 * * 1'
1311

1412
# Estate guardrail: cancel superseded runs so re-pushes / rebased PR
1513
# updates do not pile up queued runs against the shared account-wide
@@ -24,52 +22,28 @@ permissions:
2422

2523
jobs:
2624
analyze:
27-
name: Analyze (${{ matrix.language }})
2825
runs-on: ubuntu-latest
2926
permissions:
30-
security-events: write
31-
packages: read
32-
actions: read
3327
contents: read
34-
28+
security-events: write
3529
strategy:
3630
fail-fast: false
3731
matrix:
3832
include:
39-
# Uncomment languages used in your project
40-
# - language: rust
41-
# build-mode: manual
42-
# - language: go
43-
# build-mode: autobuild
44-
# - language: java-kotlin
45-
# build-mode: autobuild
4633
- language: javascript-typescript
4734
build-mode: none
48-
# - language: python
49-
# build-mode: none
5035

5136
steps:
52-
- name: Checkout repository
53-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
37+
- name: Checkout
38+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5439

5540
- name: Initialize CodeQL
56-
uses: github/codeql-action/init@ea9e4e37992a54ee68a9571571f9a567d8f90f78 # v3.28.0
41+
uses: github/codeql-action/init@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3
5742
with:
5843
languages: ${{ matrix.language }}
5944
build-mode: ${{ matrix.build-mode }}
6045

61-
- name: Build (manual mode)
62-
if: matrix.build-mode == 'manual'
63-
shell: bash
64-
run: |
65-
# Manual build commands - uncomment the appropriate line for your language
66-
# Rust: cargo build --release
67-
# Elixir: mix compile
68-
# Go: go build ./...
69-
# Java: ./gradlew build || mvn compile
70-
echo "Configure your build command above for manual build mode languages"
71-
7246
- name: Perform CodeQL Analysis
73-
uses: github/codeql-action/analyze@ea9e4e37992a54ee68a9571571f9a567d8f90f78 # v3.28.0
47+
uses: github/codeql-action/analyze@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3
7448
with:
7549
category: "/language:${{ matrix.language }}"

.github/workflows/scorecard-enforcer.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ jobs:
2727
security-events: write
2828
id-token: write # For OIDC
2929
steps:
30-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # 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@662472033e021d55d94146f66f6058822b0b39fd # v3
42+
uses: github/codeql-action/upload-sarif@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v4
4343
with:
4444
sarif_file: results.sarif
4545

@@ -62,7 +62,7 @@ jobs:
6262
check-critical:
6363
runs-on: ubuntu-latest
6464
steps:
65-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
65+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6666

6767
- name: Check SECURITY.md exists
6868
run: |

.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:
@@ -25,7 +25,7 @@ jobs:
2525
security-events: write
2626
id-token: write
2727
steps:
28-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
28+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2929
with:
3030
persist-credentials: false
3131

@@ -36,6 +36,6 @@ jobs:
3636
results_format: sarif
3737

3838
- name: Upload results
39-
uses: github/codeql-action/upload-sarif@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # 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: 12 additions & 7 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@b4ffde65f46336ab88eb53be808477a3936bae11 # 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@8a8ef8526528d8a4ff3e2c90be08e25ef8efbd9b # v3
30+
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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
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)