Skip to content

Commit

Permalink
ci-skip: add CodeQL
Browse files Browse the repository at this point in the history
Per Trail of Bits audit.

Signed-off-by: Ry Jones <[email protected]>
  • Loading branch information
ryjones committed Jul 25, 2024
1 parent 2f02bf4 commit 9623506
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
schedule:
- cron: '34 10 * * 6'

jobs:
analyze:
name: Analyze

runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}

permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]
# If your project contains more than one language supported by CodeQL you simply
# list all of the language identifiers here. The workflow will run once for each
# included language.

steps:
- 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 }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

queries: security-extended,security-and-quality
packs: trailofbits/cpp-queries

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# If the Autobuild fails above, remove it and uncomment the following three lines,
# suitably modified to build the codebase.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

0 comments on commit 9623506

Please sign in to comment.