Skip to content

Commit 8d65c8d

Browse files
ci: redistribute concurrency-cancel guard to read-only check workflows (#12)
* 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 67cb0a8 commit 8d65c8d

4 files changed

Lines changed: 29 additions & 22 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 6 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:
@@ -17,7 +17,8 @@ concurrency:
1717
group: ${{ github.workflow }}-${{ github.ref }}
1818
cancel-in-progress: true
1919

20-
permissions: read-all
20+
permissions:
21+
contents: read
2122

2223
jobs:
2324
analyze:
@@ -34,15 +35,15 @@ jobs:
3435

3536
steps:
3637
- name: Checkout
37-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
38+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3839

3940
- name: Initialize CodeQL
40-
uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # v3.28.1
41+
uses: github/codeql-action/init@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3
4142
with:
4243
languages: ${{ matrix.language }}
4344
build-mode: ${{ matrix.build-mode }}
4445

4546
- name: Perform CodeQL Analysis
46-
uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # v3.28.1
47+
uses: github/codeql-action/analyze@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3
4748
with:
4849
category: "/language:${{ matrix.language }}"

.github/workflows/scorecard-enforcer.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ concurrency:
1717
group: ${{ github.workflow }}-${{ github.ref }}
1818
cancel-in-progress: true
1919

20-
permissions: read-all
20+
permissions:
21+
contents: read
2122

2223
jobs:
2324
scorecard:
@@ -26,19 +27,19 @@ jobs:
2627
security-events: write
2728
id-token: write # For OIDC
2829
steps:
29-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
30+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3031
with:
3132
persist-credentials: false
3233

3334
- name: Run Scorecard
34-
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
35+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
3536
with:
3637
results_file: results.sarif
3738
results_format: sarif
3839
publish_results: true
3940

4041
- name: Upload SARIF
41-
uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3
42+
uses: github/codeql-action/upload-sarif@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v4
4243
with:
4344
sarif_file: results.sarif
4445

@@ -61,7 +62,7 @@ jobs:
6162
check-critical:
6263
runs-on: ubuntu-latest
6364
steps:
64-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
65+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6566

6667
- name: Check SECURITY.md exists
6768
run: |

.github/workflows/scorecard.yml

Lines changed: 6 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: OSSF Scorecard
33
on:
44
push:
@@ -15,7 +15,8 @@ concurrency:
1515
group: ${{ github.workflow }}-${{ github.ref }}
1616
cancel-in-progress: true
1717

18-
permissions: read-all
18+
permissions:
19+
contents: read
1920

2021
jobs:
2122
analysis:
@@ -24,17 +25,17 @@ jobs:
2425
security-events: write
2526
id-token: write
2627
steps:
27-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2829
with:
2930
persist-credentials: false
3031

3132
- name: Run Scorecard
32-
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.3.1
33+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.3.1
3334
with:
3435
results_file: results.sarif
3536
results_format: sarif
3637

3738
- name: Upload results
38-
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.31.8
39+
uses: github/codeql-action/upload-sarif@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3.31.8
3940
with:
4041
sarif_file: results.sarif

.github/workflows/secret-scanner.yml

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

@@ -15,18 +15,19 @@ concurrency:
1515
group: ${{ github.workflow }}-${{ github.ref }}
1616
cancel-in-progress: true
1717

18-
permissions: read-all
18+
permissions:
19+
contents: read
1920

2021
jobs:
2122
trufflehog:
2223
runs-on: ubuntu-latest
2324
steps:
24-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
25+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
2526
with:
2627
fetch-depth: 0 # Full history for scanning
2728

2829
- name: TruffleHog Secret Scan
29-
uses: trufflesecurity/trufflehog@8a8ef8526528d8a4ff3e2c90be08e25ef8efbd9b # v3
30+
uses: trufflesecurity/trufflehog@6c05c4a00b91aa542267d8e32a8254774799d68d # v3
3031
with:
3132
# The v3 action injects --fail automatically on pull_request events.
3233
# Passing --fail here triggers "flag 'fail' cannot be repeated".
@@ -35,7 +36,7 @@ jobs:
3536
gitleaks:
3637
runs-on: ubuntu-latest
3738
steps:
38-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
39+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
3940
with:
4041
fetch-depth: 0
4142

@@ -47,12 +48,15 @@ jobs:
4748
# Rust-specific: Check for hardcoded crypto values
4849
rust-secrets:
4950
runs-on: ubuntu-latest
50-
if: hashFiles('**/Cargo.toml') != ''
5151
steps:
52-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
52+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
5353

5454
- name: Check for hardcoded secrets in Rust
5555
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
5660
# Patterns that suggest hardcoded secrets
5761
PATTERNS=(
5862
'const.*SECRET.*=.*"'

0 commit comments

Comments
 (0)