Skip to content

Commit c93bebf

Browse files
authored
Turn on CodeQL (#14310)
1 parent a4d1667 commit c93bebf

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
name: "CodeQL"
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
- release-*
13+
- release/*
14+
pull_request:
15+
# The branches below must be a subset of the branches above
16+
branches: [main]
17+
schedule:
18+
- cron: '0 3 * * 0'
19+
20+
jobs:
21+
analyze:
22+
name: Analyze
23+
runs-on: ubuntu-latest
24+
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
# Override automatic language detection by changing the below list
29+
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
30+
language: ['javascript', 'python']
31+
# Learn more...
32+
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
33+
34+
steps:
35+
- name: Checkout repository
36+
uses: actions/checkout@v2
37+
with:
38+
# We must fetch at least the immediate parents so that if this is
39+
# a pull request then we can checkout the head.
40+
fetch-depth: 2
41+
42+
# If this run was triggered by a pull request event, then checkout
43+
# the head of the pull request instead of the merge commit.
44+
- run: git checkout HEAD^2
45+
if: ${{ github.event_name == 'pull_request' }}
46+
47+
# Initializes the CodeQL tools for scanning.
48+
- name: Initialize CodeQL
49+
uses: github/codeql-action/init@v1
50+
with:
51+
languages: ${{ matrix.language }}
52+
# If you wish to specify custom queries, you can do so here or in a config file.
53+
# By default, queries listed here will override any specified in a config file.
54+
# Prefix the list here with "+" to use these queries and those in the config file.
55+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
56+
57+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
58+
# If this step fails, then you should remove it and run the build manually (see below)
59+
#- name: Autobuild
60+
# uses: github/codeql-action/autobuild@v1
61+
62+
# ℹ️ Command-line programs to run using the OS shell.
63+
# 📚 https://git.io/JvXDl
64+
65+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
66+
# and modify them (or add more) to build your code if your project
67+
# uses a compiled language
68+
69+
#- run: |
70+
# make bootstrap
71+
# make release
72+
73+
- name: Perform CodeQL Analysis
74+
uses: github/codeql-action/analyze@v1

0 commit comments

Comments
 (0)