Skip to content

Commit e452312

Browse files
authored
Add CodeQL workflow (#2882)
1 parent 101bf68 commit e452312

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ 'main' ]
6+
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [ 'main' ]
9+
schedule:
10+
- cron: '10 20 * * 4'
11+
12+
jobs:
13+
analyze:
14+
name: Analyze
15+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
16+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
17+
permissions:
18+
actions: read
19+
contents: read
20+
security-events: write
21+
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
language: [ 'javascript', 'python' ]
26+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
27+
# Use only 'java' to analyze code written in Java, Kotlin or both
28+
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
29+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
30+
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v3
34+
35+
# Initializes the CodeQL tools for scanning.
36+
- name: Initialize CodeQL
37+
uses: github/codeql-action/init@v2
38+
with:
39+
languages: ${{ matrix.language }}
40+
# If you wish to specify custom queries, you can do so here or in a config file.
41+
# By default, queries listed here will override any specified in a config file.
42+
# Prefix the list here with "+" to use these queries and those in the config file.
43+
44+
# 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
45+
# queries: security-extended,security-and-quality
46+
47+
48+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
49+
# If this step fails, then you should remove it and run the build manually (see below)
50+
- name: Autobuild
51+
uses: github/codeql-action/autobuild@v2
52+
53+
# ℹ️ Command-line programs to run using the OS shell.
54+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
55+
56+
# If the Autobuild fails above, remove it and uncomment the following three lines.
57+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
58+
59+
# - run: |
60+
# echo "Run, Build Application using script"
61+
# ./location_of_script_within_repo/buildscript.sh
62+
63+
- name: Perform CodeQL Analysis
64+
uses: github/codeql-action/analyze@v2
65+
with:
66+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)