Skip to content

Commit 4cd2130

Browse files
ci: redistribute concurrency-cancel guard to read-only check workflows (#18)
* 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 a81ccc5 commit 4cd2130

4 files changed

Lines changed: 44 additions & 96 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 27 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,49 @@
1-
# SPDX-License-Identifier: PMPL-1.0-or-later
2-
# For most projects, this workflow file will not need changing; you simply need
3-
# to commit it to your repository.
4-
#
5-
# You may wish to alter this file to override the set of languages analyzed,
6-
# or to provide custom queries or build logic.
7-
#
8-
# ******** NOTE ********
9-
# We have attempted to detect the languages in your repository. Please check
10-
# the `language` matrix defined below to confirm you have the correct set of
11-
# supported CodeQL languages.
12-
#
13-
name: "CodeQL Advanced"
1+
# SPDX-License-Identifier: PMPL-1.0
2+
name: CodeQL Security Analysis
3+
144
on:
155
push:
16-
branches: ["main"]
6+
branches: [main, master]
177
pull_request:
18-
branches: ["main"]
8+
branches: [main, master]
199
schedule:
20-
- cron: '16 7 * * 1'
10+
- cron: '0 6 * * 1'
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.
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
permissions:
21+
contents: read
22+
2123
jobs:
2224
analyze:
23-
name: Analyze (${{ matrix.language }})
24-
# Runner size impacts CodeQL analysis time. To learn more, please see:
25-
# - https://gh.io/recommended-hardware-resources-for-running-codeql
26-
# - https://gh.io/supported-runners-and-hardware-resources
27-
# - https://gh.io/using-larger-runners (GitHub.com only)
28-
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
29-
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
25+
runs-on: ubuntu-latest
3026
permissions:
31-
# required for all workflows
32-
security-events: write
33-
# required to fetch internal or private CodeQL packs
34-
packages: read
35-
# only required for workflows in private repositories
36-
actions: read
3727
contents: read
28+
security-events: write
3829
strategy:
3930
fail-fast: false
4031
matrix:
4132
include:
42-
- language: actions
33+
- language: javascript-typescript
4334
build-mode: none
44-
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
45-
# Use `c-cpp` to analyze code written in C, C++ or both
46-
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
47-
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
48-
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
49-
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
50-
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
51-
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
35+
5236
steps:
53-
- name: Checkout repository
54-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
55-
# Add any setup steps before running the `github/codeql-action/init` action.
56-
# This includes steps like installing compilers or runtimes (`actions/setup-node`
57-
# or others). This is typically only required for manual builds.
58-
# - name: Setup runtime (example)
59-
# uses: actions/setup-example@v1
37+
- name: Checkout
38+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6039

61-
# Initializes the CodeQL tools for scanning.
6240
- name: Initialize CodeQL
63-
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4
41+
uses: github/codeql-action/init@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3
6442
with:
6543
languages: ${{ matrix.language }}
6644
build-mode: ${{ matrix.build-mode }}
67-
# If you wish to specify custom queries, you can do so here or in a config file.
68-
# By default, queries listed here will override any specified in a config file.
69-
# Prefix the list here with "+" to use these queries and those in the config file.
70-
# If the analyze step fails for one of the languages you are analyzing with
71-
# "We were unable to automatically build your code", modify the matrix above
72-
# to set the build mode to "manual" for that language. Then modify this step
73-
# to build your code.
74-
# ℹ️ Command-line programs to run using the OS shell.
75-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
76-
- name: Run manual build steps
77-
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
78-
# queries: security-extended,security-and-quality
7945

80-
if: matrix.build-mode == 'manual'
81-
shell: bash
82-
run: |
83-
echo 'If you are using a "manual" build mode for one or more of the' \
84-
'languages you are analyzing, replace this with the commands to build' \
85-
'your code, for example:'
86-
echo ' make bootstrap'
87-
echo ' make release'
88-
exit 1
8946
- name: Perform CodeQL Analysis
90-
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4
47+
uses: github/codeql-action/analyze@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3
9148
with:
92-
category: "/language:${{matrix.language}}"
93-
# Estate guardrail: cancel superseded runs so re-pushes / rebased PR
94-
# updates do not pile up queued runs against the shared account-wide
95-
# Actions concurrency pool. Applied only to read-only check workflows
96-
# (no publish/mutation), so cancelling a superseded run is always safe.
97-
concurrency:
98-
group: ${{ github.workflow }}-${{ github.ref }}
99-
cancel-in-progress: true
100-
101-
permissions:
102-
contents: read
49+
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@34e114876b0b11c390a56381ad16ebd13914f8d5 # 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@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
65+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6666

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

.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@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
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@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4
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: 5 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
# Prevention workflow - scans for hardcoded secrets before they reach main
33
name: Secret Scanner
44

@@ -22,12 +22,12 @@ jobs:
2222
trufflehog:
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # 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:
3232
# The v3 action injects --fail automatically on pull_request events.
3333
# Passing --fail here triggers "flag 'fail' cannot be repeated".
@@ -36,7 +36,7 @@ jobs:
3636
gitleaks:
3737
runs-on: ubuntu-latest
3838
steps:
39-
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
39+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
4040
with:
4141
fetch-depth: 0
4242

@@ -49,7 +49,7 @@ jobs:
4949
rust-secrets:
5050
runs-on: ubuntu-latest
5151
steps:
52-
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
52+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
5353

5454
- name: Check for hardcoded secrets in Rust
5555
run: |

0 commit comments

Comments
 (0)