Skip to content

Commit 9db09fa

Browse files
committed
Add CodeQL workflow
1 parent 0852816 commit 9db09fa

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed

.github/workflows/codeql.yml

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

0 commit comments

Comments
 (0)