Skip to content

Commit 806f56d

Browse files
committed
ci: redistribute canonical codeql.yml (concurrency-cancel guard) (Refs hyperpolymath/standards#122)
1 parent 7bfc309 commit 806f56d

1 file changed

Lines changed: 29 additions & 97 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 29 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
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-
#
1+
# SPDX-License-Identifier: PMPL-1.0
2+
name: CodeQL Security Analysis
3+
4+
on:
5+
push:
6+
branches: [main, master]
7+
pull_request:
8+
branches: [main, master]
9+
schedule:
10+
- cron: '0 6 * * 1'
11+
1312
# Estate guardrail: cancel superseded runs so re-pushes / rebased PR
1413
# updates do not pile up queued runs against the shared account-wide
1514
# Actions concurrency pool. Applied only to read-only check workflows
@@ -21,97 +20,30 @@ concurrency:
2120
permissions:
2221
contents: read
2322

24-
name: "CodeQL Advanced"
25-
26-
on:
27-
push:
28-
branches: [ "main" ]
29-
pull_request:
30-
branches: [ "main" ]
31-
schedule:
32-
- cron: '31 6 * * 3'
33-
3423
jobs:
3524
analyze:
36-
name: Analyze (${{ matrix.language }})
37-
# Runner size impacts CodeQL analysis time. To learn more, please see:
38-
# - https://gh.io/recommended-hardware-resources-for-running-codeql
39-
# - https://gh.io/supported-runners-and-hardware-resources
40-
# - https://gh.io/using-larger-runners (GitHub.com only)
41-
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
42-
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
25+
runs-on: ubuntu-latest
4326
permissions:
44-
# required for all workflows
45-
security-events: write
46-
47-
# required to fetch internal or private CodeQL packs
48-
packages: read
49-
50-
# only required for workflows in private repositories
51-
actions: read
5227
contents: read
53-
28+
security-events: write
5429
strategy:
5530
fail-fast: false
5631
matrix:
5732
include:
58-
- language: java-kotlin
59-
build-mode: autobuild
60-
- language: javascript-typescript
61-
build-mode: none
62-
- language: python
63-
build-mode: none
64-
- language: rust
65-
build-mode: none
66-
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
67-
# Use `c-cpp` to analyze code written in C, C++ or both
68-
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
69-
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
70-
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
71-
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
72-
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
73-
# 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
74-
steps:
75-
- name: Checkout repository
76-
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
33+
- language: javascript-typescript
34+
build-mode: none
7735

78-
# Add any setup steps before running the `github/codeql-action/init` action.
79-
# This includes steps like installing compilers or runtimes (`actions/setup-node`
80-
# or others). This is typically only required for manual builds.
81-
# - name: Setup runtime (example)
82-
# uses: actions/setup-example@v1
83-
84-
# Initializes the CodeQL tools for scanning.
85-
- name: Initialize CodeQL
86-
uses: github/codeql-action/init@b2f9ef845756500b97acbdaf5c1dd4e9c1d15734 # v3
87-
with:
88-
languages: ${{ matrix.language }}
89-
build-mode: ${{ matrix.build-mode }}
90-
# If you wish to specify custom queries, you can do so here or in a config file.
91-
# By default, queries listed here will override any specified in a config file.
92-
# Prefix the list here with "+" to use these queries and those in the config file.
93-
94-
# 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
95-
# queries: security-extended,security-and-quality
96-
97-
# If the analyze step fails for one of the languages you are analyzing with
98-
# "We were unable to automatically build your code", modify the matrix above
99-
# to set the build mode to "manual" for that language. Then modify this step
100-
# to build your code.
101-
# ℹ️ Command-line programs to run using the OS shell.
102-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
103-
- name: Run manual build steps
104-
if: matrix.build-mode == 'manual'
105-
shell: bash
106-
run: |
107-
echo 'If you are using a "manual" build mode for one or more of the' \
108-
'languages you are analyzing, replace this with the commands to build' \
109-
'your code, for example:'
110-
echo ' make bootstrap'
111-
echo ' make release'
112-
exit 1
113-
114-
- name: Perform CodeQL Analysis
115-
uses: github/codeql-action/analyze@b2f9ef845756500b97acbdaf5c1dd4e9c1d15734 # v3
116-
with:
117-
category: "/language:${{matrix.language}}"
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
39+
40+
- name: Initialize CodeQL
41+
uses: github/codeql-action/init@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3
42+
with:
43+
languages: ${{ matrix.language }}
44+
build-mode: ${{ matrix.build-mode }}
45+
46+
- name: Perform CodeQL Analysis
47+
uses: github/codeql-action/analyze@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3
48+
with:
49+
category: "/language:${{ matrix.language }}"

0 commit comments

Comments
 (0)