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