Skip to content

Commit b962442

Browse files
committed
Add CodeQL Code Scanning
1 parent cb76dfe commit b962442

File tree

1 file changed

+36
-57
lines changed

1 file changed

+36
-57
lines changed

.github/workflows/codeql.yml

Lines changed: 36 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,53 @@
11
name: Code Scanning - CodeQL
22
on:
33
push:
4-
branches:
5-
- main
4+
branches:
5+
- main
66
pull_request:
7-
branches:
8-
- main
7+
branches:
8+
- main
99
schedule:
10-
- cron: '38 17 * * 2'
10+
- cron: "00 10 * * 6"
1111

1212
jobs:
1313
analyze:
14-
name: Analyze
15-
# Runner size impacts CodeQL analysis time. To learn more, please see:
16-
# - https://gh.io/recommended-hardware-resources-for-running-codeql
17-
# - https://gh.io/supported-runners-and-hardware-resources
18-
# - https://gh.io/using-larger-runners
19-
# Consider using larger runners for possible analysis time improvements.
20-
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
21-
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
14+
name: Analyze Code
15+
runs-on: [ubuntu-latest]
16+
timeout-minutes: 360
17+
2218
permissions:
23-
# required for all workflows
2419
security-events: write
25-
2620
# only required for workflows in private repositories
27-
actions: read
28-
contents: read
21+
# actions: read
22+
# contents: read
2923

3024
strategy:
3125
fail-fast: false
3226
matrix:
33-
language: [ 'python' ]
34-
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
35-
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
36-
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
37-
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
27+
language: ["python"]
3828

3929
steps:
40-
- name: Checkout repository
41-
uses: actions/checkout@v4
42-
43-
# Initializes the CodeQL tools for scanning.
44-
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v3
46-
with:
47-
languages: ${{ matrix.language }}
48-
# If you wish to specify custom queries, you can do so here or in a config file.
49-
# By default, queries listed here will override any specified in a config file.
50-
# Prefix the list here with "+" to use these queries and those in the config file.
51-
52-
# 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
53-
# queries: security-extended,security-and-quality
54-
55-
56-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
57-
# If this step fails, then you should remove it and run the build manually (see below)
58-
- name: Autobuild
59-
uses: github/codeql-action/autobuild@v3
60-
61-
# ℹ️ Command-line programs to run using the OS shell.
62-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
63-
64-
# If the Autobuild fails above, remove it and uncomment the following three lines.
65-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
66-
67-
# - run: |
68-
# echo "Run, Build Application using script"
69-
# ./location_of_script_within_repo/buildscript.sh
70-
71-
- name: Perform CodeQL Analysis
72-
uses: github/codeql-action/analyze@v3
73-
with:
74-
category: "/language:${{matrix.language}}"
30+
# Checkout repository
31+
- name: Check Out Repository
32+
id: checkout_repository
33+
uses: actions/checkout@v4
34+
35+
# CodeQL initialization of tools for scanning
36+
- name: CodeQL - Initialize
37+
id: codeql_init
38+
uses: github/codeql-action/init@v3
39+
with:
40+
languages: ${{ matrix.language }}
41+
42+
43+
# CodeQL autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
44+
- name: CodeQL - Autobuild
45+
id: codeql_build
46+
uses: github/codeql-action/autobuild@v3
47+
48+
# CodeQL analysis of code
49+
- name: CodeQL - Analysis
50+
id: codeql_analyze
51+
uses: github/codeql-action/analyze@v3
52+
with:
53+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)