Skip to content
This repository was archived by the owner on Jul 21, 2026. It is now read-only.

Commit 0770f91

Browse files
ci: redistribute concurrency-cancel guard to read-only check workflows (#78)
Redistributes the canonical read-only-check workflow templates that gained `concurrency{cancel-in-progress:true}` in hyperpolymath/standards#122, so this consumer stops holding account-wide concurrent-job slots on superseded runs. Files updated: codeql.yml governance.yml scorecard-enforcer.yml scorecard.yml secret-scanner.yml. Read-only checks only; no publish/mutation workflow touched. Refs hyperpolymath/standards#122 Generated with Claude Code
1 parent a236f6b commit 0770f91

4 files changed

Lines changed: 32 additions & 53 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 12 additions & 39 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:
@@ -8,9 +8,11 @@ on:
88
branches: [main, master]
99
schedule:
1010
- cron: '0 6 * * 1'
11-
# Estate guardrail: cancel superseded runs so re-pushes don't pile up
12-
# queued runs across the estate. Safe here because this workflow only
13-
# performs read-only checks/lint/test/scan with no publish or mutation.
11+
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.
1416
concurrency:
1517
group: ${{ github.workflow }}-${{ github.ref }}
1618
cancel-in-progress: true
@@ -19,58 +21,29 @@ permissions:
1921
contents: read
2022

2123
jobs:
22-
# The estate is heterogeneous (Rust, Idris2, Agda, Elixir, ReScript,
23-
# occasional JS/TS/Python). A hard-coded `javascript-typescript` matrix
24-
# made CodeQL exit with a "no source / configuration error" on every
25-
# non-JS/TS repo — a permanent false-red `analyze` on most repos' main.
26-
# Detect the languages the repo ACTUALLY contains and only analyse the
27-
# CodeQL-supported, buildless-safe ones; skip entirely when none apply.
28-
detect:
29-
runs-on: ubuntu-latest
30-
outputs:
31-
langs: ${{ steps.pick.outputs.langs }}
32-
steps:
33-
- name: Pick CodeQL languages from repo language stats
34-
id: pick
35-
env:
36-
GH_TOKEN: ${{ github.token }}
37-
run: |
38-
stats=$(gh api "repos/${{ github.repository }}/languages" --jq 'keys[]' 2>/dev/null || echo "")
39-
out=""
40-
add() { out="$out $1"; }
41-
echo "$stats" | grep -qix 'Rust' && add rust
42-
echo "$stats" | grep -qixE 'JavaScript|TypeScript' && add javascript-typescript
43-
echo "$stats" | grep -qix 'Python' && add python
44-
echo "$stats" | grep -qix 'Ruby' && add ruby
45-
echo "$stats" | grep -qix 'Go' && add go
46-
arr=$(printf '%s\n' $out | grep . | sort -u | jq -R . | jq -s -c .)
47-
[ -z "$arr" ] && arr='[]'
48-
echo "Detected CodeQL languages: $arr"
49-
echo "langs=$arr" >> "$GITHUB_OUTPUT"
50-
5124
analyze:
52-
needs: detect
53-
if: needs.detect.outputs.langs != '[]'
5425
runs-on: ubuntu-latest
5526
permissions:
5627
contents: read
5728
security-events: write
5829
strategy:
5930
fail-fast: false
6031
matrix:
61-
language: ${{ fromJSON(needs.detect.outputs.langs) }}
32+
include:
33+
- language: javascript-typescript
34+
build-mode: none
6235

6336
steps:
6437
- name: Checkout
6538
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6639

6740
- name: Initialize CodeQL
68-
uses: github/codeql-action/init@0d579ffd059c29b07949a3cce3983f0780820c98 # v3.28.1
41+
uses: github/codeql-action/init@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3
6942
with:
7043
languages: ${{ matrix.language }}
71-
build-mode: none
44+
build-mode: ${{ matrix.build-mode }}
7245

7346
- name: Perform CodeQL Analysis
74-
uses: github/codeql-action/analyze@0d579ffd059c29b07949a3cce3983f0780820c98 # v3.28.1
47+
uses: github/codeql-action/analyze@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3
7548
with:
7649
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: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
# SPDX-License-Identifier: PMPL-1.0-or-later
1+
# SPDX-License-Identifier: PMPL-1.0
22
name: OSSF Scorecard
33
on:
44
push:
55
branches: [main, master]
66
schedule:
7-
- cron: '0 4 * * 0'
7+
- cron: '0 4 * * *'
8+
workflow_dispatch:
89

910
# Estate guardrail: cancel superseded runs so re-pushes / rebased PR
1011
# updates do not pile up queued runs against the shared account-wide
@@ -24,17 +25,17 @@ jobs:
2425
security-events: write
2526
id-token: write
2627
steps:
27-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
28+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2829
with:
2930
persist-credentials: false
30-
31+
3132
- name: Run Scorecard
32-
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
33+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.3.1
3334
with:
3435
results_file: results.sarif
3536
results_format: sarif
36-
37+
3738
- name: Upload results
38-
uses: github/codeql-action/upload-sarif@b2f9ef845756500b97acbdaf5c1dd4e9c1d15734 # v3
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 & 6 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@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
3030
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

@@ -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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
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)