Skip to content

Commit 35fb302

Browse files
ci: redistribute concurrency-cancel guard to read-only check workflows (#29)
* 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 0dd6990 commit 35fb302

4 files changed

Lines changed: 42 additions & 39 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# SPDX-License-Identifier: PMPL-1.0-or-later
2-
name: CodeQL
1+
# SPDX-License-Identifier: PMPL-1.0
2+
name: CodeQL Security Analysis
33

44
on:
55
push:
6-
branches: [ main ]
6+
branches: [main, master]
77
pull_request:
8-
branches: [ main ]
8+
branches: [main, master]
99
schedule:
10-
- cron: '0 0 * * 1' # Weekly on Monday
10+
- cron: '0 6 * * 1'
1111

1212
# Estate guardrail: cancel superseded runs so re-pushes / rebased PR
1313
# updates do not pile up queued runs against the shared account-wide
@@ -18,31 +18,32 @@ concurrency:
1818
cancel-in-progress: true
1919

2020
permissions:
21-
actions: read
2221
contents: read
23-
security-events: write
2422

2523
jobs:
2624
analyze:
27-
name: Analyze
2825
runs-on: ubuntu-latest
26+
permissions:
27+
contents: read
28+
security-events: write
2929
strategy:
3030
fail-fast: false
3131
matrix:
32-
language: [ 'rust' ]
32+
include:
33+
- language: javascript-typescript
34+
build-mode: none
35+
3336
steps:
34-
- name: Checkout code
35-
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
37+
- name: Checkout
38+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3639

3740
- name: Initialize CodeQL
38-
uses: github/codeql-action/init@b2f9ef845756500b97acbdaf5c1dd4e9c1d15734 # v3
41+
uses: github/codeql-action/init@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3
3942
with:
4043
languages: ${{ matrix.language }}
41-
42-
- name: Autobuild
43-
uses: github/codeql-action/autobuild@b2f9ef845756500b97acbdaf5c1dd4e9c1d15734 # v3
44+
build-mode: ${{ matrix.build-mode }}
4445

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

.github/workflows/scorecard-enforcer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
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

.github/workflows/scorecard.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
# SPDX-License-Identifier: PMPL-1.0-or-later
2-
name: OpenSSF Scorecard
3-
1+
# SPDX-License-Identifier: PMPL-1.0
2+
name: OSSF Scorecard
43
on:
5-
branch_protection_rule:
6-
schedule:
7-
- cron: '0 0 * * 2' # Weekly on Tuesday
84
push:
9-
branches: [ main ]
5+
branches: [main, master]
6+
schedule:
7+
- cron: '0 4 * * *'
8+
workflow_dispatch:
109

1110
# Estate guardrail: cancel superseded runs so re-pushes / rebased PR
1211
# updates do not pile up queued runs against the shared account-wide
@@ -21,25 +20,22 @@ permissions:
2120

2221
jobs:
2322
analysis:
24-
name: Scorecard analysis
2523
runs-on: ubuntu-latest
2624
permissions:
2725
security-events: write
2826
id-token: write
2927
steps:
30-
- name: Checkout code
31-
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
28+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3229
with:
3330
persist-credentials: false
3431

35-
- name: Run analysis
36-
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
32+
- name: Run Scorecard
33+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.3.1
3734
with:
3835
results_file: results.sarif
3936
results_format: sarif
40-
publish_results: true
4137

42-
- name: Upload to code-scanning
43-
uses: github/codeql-action/upload-sarif@b2f9ef845756500b97acbdaf5c1dd4e9c1d15734 # v3
38+
- name: Upload results
39+
uses: github/codeql-action/upload-sarif@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3.31.8
4440
with:
4541
sarif_file: results.sarif

.github/workflows/secret-scanner.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-License-Identifier: MPL-2.0
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
30-
uses: trufflesecurity/trufflehog@6961f2bace57ab32b23b3ba40f8f420f6bc7e004 # 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
39+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
3840
with:
3941
fetch-depth: 0
4042

@@ -47,10 +49,14 @@ jobs:
4749
rust-secrets:
4850
runs-on: ubuntu-latest
4951
steps:
50-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
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)