Skip to content

Commit 8eda8fe

Browse files
ci: redistribute concurrency-cancel guard to read-only check workflows (#16)
* 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 965267c commit 8eda8fe

4 files changed

Lines changed: 38 additions & 26 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 14 additions & 10 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:
@@ -9,7 +9,16 @@ on:
99
schedule:
1010
- cron: '0 6 * * 1'
1111

12-
permissions: read-all
12+
# Estate guardrail: cancel superseded runs so re-pushes / rebased PR
13+
# updates do not pile up queued runs against the shared account-wide
14+
# Actions concurrency pool. Applied only to read-only check workflows
15+
# (no publish/mutation), so cancelling a superseded run is always safe.
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
permissions:
21+
contents: read
1322

1423
jobs:
1524
analyze:
@@ -26,20 +35,15 @@ jobs:
2635

2736
steps:
2837
- name: Checkout
29-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
38+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3039

3140
- name: Initialize CodeQL
32-
uses: github/codeql-action/init@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v3.28.1
41+
uses: github/codeql-action/init@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3
3342
with:
3443
languages: ${{ matrix.language }}
3544
build-mode: ${{ matrix.build-mode }}
3645

3746
- name: Perform CodeQL Analysis
38-
uses: github/codeql-action/analyze@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v3.28.1
47+
uses: github/codeql-action/analyze@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3
3948
with:
4049
category: "/language:${{ matrix.language }}"
41-
42-
- name: K9-SVC Validation
43-
run: |
44-
echo "K9-SVC validation"
45-
[ -d .machine_readable/contractiles ] && echo "Contractiles present" || echo "No contractiles"

.github/workflows/scorecard-enforcer.yml

Lines changed: 5 additions & 4 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,7 +27,7 @@ jobs:
2627
security-events: write
2728
id-token: write # For OIDC
2829
steps:
29-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
30+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3031
with:
3132
persist-credentials: false
3233

@@ -38,7 +39,7 @@ jobs:
3839
publish_results: true
3940

4041
- name: Upload SARIF
41-
uses: github/codeql-action/upload-sarif@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # 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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
65+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6566

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

.github/workflows/scorecard.yml

Lines changed: 5 additions & 4 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,7 +25,7 @@ jobs:
2425
security-events: write
2526
id-token: write
2627
steps:
27-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
28+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2829
with:
2930
persist-credentials: false
3031

@@ -35,6 +36,6 @@ jobs:
3536
results_format: sarif
3637

3738
- name: Upload results
38-
uses: github/codeql-action/upload-sarif@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # 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: 14 additions & 8 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,25 +15,28 @@ 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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # 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@116e7171542d2f1dad8810f00dcfacbe0b809183 # v3
30+
uses: trufflesecurity/trufflehog@6c05c4a00b91aa542267d8e32a8254774799d68d # v3
3031
with:
31-
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
3235

3336
gitleaks:
3437
runs-on: ubuntu-latest
3538
steps:
36-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
39+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
3740
with:
3841
fetch-depth: 0
3942

@@ -45,12 +48,15 @@ jobs:
4548
# Rust-specific: Check for hardcoded crypto values
4649
rust-secrets:
4750
runs-on: ubuntu-latest
48-
if: hashFiles('**/Cargo.toml') != ''
4951
steps:
50-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
52+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
5153

5254
- name: Check for hardcoded secrets in Rust
5355
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
5460
# Patterns that suggest hardcoded secrets
5561
PATTERNS=(
5662
'const.*SECRET.*=.*"'

0 commit comments

Comments
 (0)