CodeQL #13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# For most projects, this workflow file will not need changing; you simply need | |
# to commit it to your repository. | |
# | |
# You may wish to alter this file to override the set of languages analyzed, | |
# or to provide custom queries or build logic. | |
name: CodeQL | |
# The use of on here as a key is part of the GitHub actions syntax. | |
# yamllint disable-line rule:truthy | |
on: | |
merge_group: | |
types: | |
- checks_requested | |
pull_request: | |
# The branches here must be a subset of the ones in the push key | |
branches: | |
- develop | |
push: | |
# Dependabot-triggered push events have read-only access, but uploading code | |
# scanning requires write access. | |
branches-ignore: | |
- dependabot/** | |
schedule: | |
- cron: 0 2 * * 6 | |
jobs: | |
diagnostics: | |
name: Run diagnostics | |
# This job does not need any permissions | |
permissions: {} | |
runs-on: ubuntu-latest | |
steps: | |
# Note that a duplicate of this step must be added at the top of | |
# each job. | |
- name: Apply standard cisagov job preamble | |
uses: cisagov/action-job-preamble@v1 | |
with: | |
check_github_status: "true" | |
# This functionality is poorly implemented and has been | |
# causing problems due to the MITM implementation hogging or | |
# leaking memory. As a result we disable it by default. If | |
# you want to temporarily enable it, simply set | |
# monitor_permissions equal to "true". | |
# | |
# TODO: Re-enable this functionality when practical. See | |
# cisagov/skeleton-generic#207 for more details. | |
monitor_permissions: "false" | |
output_workflow_context: "true" | |
# Use a variable to specify the permissions monitoring | |
# configuration. By default this will yield the | |
# configuration stored in the cisagov organization-level | |
# variable, but if you want to use a different configuration | |
# then simply: | |
# 1. Create a repository-level variable with the name | |
# ACTIONS_PERMISSIONS_CONFIG. | |
# 2. Set this new variable's value to the configuration you | |
# want to use for this repository. | |
# | |
# Note in particular that changing the permissions | |
# monitoring configuration *does not* require you to modify | |
# this workflow. | |
permissions_monitoring_config: ${{ vars.ACTIONS_PERMISSIONS_CONFIG }} | |
analyze: | |
name: Analyze | |
needs: | |
- diagnostics | |
runs-on: ubuntu-latest | |
permissions: | |
# actions/checkout needs this to fetch code | |
contents: read | |
# required for all workflows | |
security-events: write | |
strategy: | |
fail-fast: false | |
matrix: | |
# Override automatic language detection by changing the below | |
# list | |
# | |
# Supported options are actions, c-cpp, csharp, go, | |
# java-kotlin, javascript-typescript, python, ruby, and swift. | |
language: | |
- actions | |
# Learn more... | |
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection | |
steps: | |
- name: Apply standard cisagov job preamble | |
uses: cisagov/action-job-preamble@v1 | |
with: | |
# This functionality is poorly implemented and has been | |
# causing problems due to the MITM implementation hogging or | |
# leaking memory. As a result we disable it by default. If | |
# you want to temporarily enable it, simply set | |
# monitor_permissions equal to "true". | |
# | |
# TODO: Re-enable this functionality when practical. See | |
# cisagov/skeleton-generic#207 for more details. | |
monitor_permissions: "false" | |
# Use a variable to specify the permissions monitoring | |
# configuration. By default this will yield the | |
# configuration stored in the cisagov organization-level | |
# variable, but if you want to use a different configuration | |
# then simply: | |
# 1. Create a repository-level variable with the name | |
# ACTIONS_PERMISSIONS_CONFIG. | |
# 2. Set this new variable's value to the configuration you | |
# want to use for this repository. | |
# | |
# Note in particular that changing the permissions | |
# monitoring configuration *does not* require you to modify | |
# this workflow. | |
permissions_monitoring_config: ${{ vars.ACTIONS_PERMISSIONS_CONFIG }} | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# Initializes the CodeQL tools for scanning. | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v3 | |
with: | |
languages: ${{ matrix.language }} | |
# Autobuild attempts to build any compiled languages (C/C++, C#, or | |
# Java). If this step fails, then you should remove it and run the build | |
# manually (see below). | |
- name: Autobuild | |
uses: github/codeql-action/autobuild@v3 | |
# ℹ️ Command-line programs to run using the OS shell. | |
# 📚 https://git.io/JvXDl | |
# ✏️ If the Autobuild fails above, remove it and uncomment the following | |
# three lines and modify them (or add more) to build your code if your | |
# project uses a compiled language | |
# - run: | | |
# make bootstrap | |
# make release | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v3 |