Skip to content

Commit 6b23b9f

Browse files
committed
codeql.yml uplifted
1 parent 4e1b056 commit 6b23b9f

File tree

1 file changed

+45
-33
lines changed

1 file changed

+45
-33
lines changed

.github/workflows/codeql.yml

Lines changed: 45 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,59 +9,68 @@
99
# the `language` matrix defined below to confirm you have the correct set of
1010
# supported CodeQL languages.
1111
#
12-
name: "CodeQL"
12+
name: "CodeQL Advanced"
1313

1414
on:
1515
push:
16-
branches: [ "master", "analyze-security" ]
16+
branches: [ "master" ]
1717
pull_request:
18-
# The branches below must be a subset of the branches above
1918
branches: [ "master" ]
2019
schedule:
21-
- cron: '28 3 * * 1'
20+
- cron: '36 13 * * 3'
2221

2322
jobs:
2423
analyze:
25-
name: Analyze
24+
name: Analyze (${{ matrix.language }})
2625
# Runner size impacts CodeQL analysis time. To learn more, please see:
2726
# - https://gh.io/recommended-hardware-resources-for-running-codeql
2827
# - https://gh.io/supported-runners-and-hardware-resources
29-
# - https://gh.io/using-larger-runners
30-
# Consider using larger runners for possible analysis time improvements.
28+
# - https://gh.io/using-larger-runners (GitHub.com only)
29+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
3130
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
32-
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
3331
permissions:
32+
# required for all workflows
33+
security-events: write
34+
35+
# required to fetch internal or private CodeQL packs
36+
packages: read
37+
38+
# only required for workflows in private repositories
3439
actions: read
3540
contents: read
36-
security-events: write
3741

3842
strategy:
3943
fail-fast: false
4044
matrix:
41-
language: [ 'java-kotlin' ]
42-
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
43-
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
44-
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
45-
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
46-
45+
include:
46+
- language: actions
47+
build-mode: none
48+
- language: java-kotlin
49+
build-mode: none # This mode only analyzes Java. Set this to 'autobuild' or 'manual' to analyze Kotlin too.
50+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
51+
# Use `c-cpp` to analyze code written in C, C++ or both
52+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
53+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
54+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
55+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
56+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
57+
# 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
4758
steps:
4859
- name: Checkout repository
4960
uses: actions/checkout@v4
5061

51-
- name: set up jdk 17
52-
uses: actions/setup-java@v4
53-
with:
54-
distribution: 'temurin'
55-
java-version: '17'
56-
57-
- name: checkout code
58-
uses: actions/checkout@v4
62+
# Add any setup steps before running the `github/codeql-action/init` action.
63+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
64+
# or others). This is typically only required for manual builds.
65+
# - name: Setup runtime (example)
66+
# uses: actions/setup-example@v1
5967

6068
# Initializes the CodeQL tools for scanning.
6169
- name: Initialize CodeQL
6270
uses: github/codeql-action/init@v3
6371
with:
6472
languages: ${{ matrix.language }}
73+
build-mode: ${{ matrix.build-mode }}
6574
# If you wish to specify custom queries, you can do so here or in a config file.
6675
# By default, queries listed here will override any specified in a config file.
6776
# Prefix the list here with "+" to use these queries and those in the config file.
@@ -70,18 +79,21 @@ jobs:
7079
# queries: security-extended,security-and-quality
7180
config-file: .github/workflows/codeql-filters.yml
7281

73-
74-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
75-
# If this step fails, then you should remove it and run the build manually (see below)
76-
82+
# If the analyze step fails for one of the languages you are analyzing with
83+
# "We were unable to automatically build your code", modify the matrix above
84+
# to set the build mode to "manual" for that language. Then modify this step
85+
# to build your code.
7786
# ℹ️ Command-line programs to run using the OS shell.
7887
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
79-
80-
# If the Autobuild fails above, remove it and uncomment the following three lines.
81-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
82-
83-
- run: |
84-
mvn clean package -DskipTests
88+
- if: matrix.build-mode == 'manual'
89+
shell: bash
90+
run: |
91+
echo 'If you are using a "manual" build mode for one or more of the' \
92+
'languages you are analyzing, replace this with the commands to build' \
93+
'your code, for example:'
94+
echo ' make bootstrap'
95+
echo ' make release'
96+
exit 1
8597
8698
- name: Perform CodeQL Analysis
8799
uses: github/codeql-action/analyze@v3

0 commit comments

Comments
 (0)