Skip to content

CodeQL Advanced

CodeQL Advanced #37

Workflow file for this run

# 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.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"
on:
push:
branches: [ "master" ]
paths-ignore:
- '**/*.md'
- '**/*.txt'
pull_request:
branches: [ "master" ]
paths-ignore:
- '**/*.md'
- '**/*.txt'
schedule:
- cron: '19 6 * * 0'
permissions:
contents: read
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ${{ matrix.runner-os }}
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
runner-os: [ 'ubuntu-22.04' ]
language: [c-cpp]
build-mode: [manual]
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
defaults:
run:
shell: bash
steps:
- name: 'Harden Runner'
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
with:
egress-policy: audit
- name: Checkout repository
#uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #4.2.2
- name: Check disk space
run: df -h
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
#uses: github/codeql-action/init@v3
uses: github/codeql-action/init@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
with:
languages: ${{ matrix.language }}
# Passing a config that excludes specific directories
config: |
paths-ignore:
- ivsr_ffmpeg_plugin/ffmpeg
- ivsr_ov/based_on_openvino_2022.3/openvino
# 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.
# 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
# queries: security-extended,security-and-quality
- name: Git config
run: |
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
- name: Build
run: |
chmod a+x ./build.sh
./build.sh --ov_version 2024.5
echo 'build ivsr completed!'
- name: Perform CodeQL Analysis
#uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
with:
category: "/language:${{matrix.language}}"
output: results
upload: failure-only
- name: Filter Sarif
uses: advanced-security/filter-sarif@v1
with:
patterns: |
-ivsr_ffmpeg_plugin/ffmpeg/**/*
-ivsr_ov/based_on_openvino_2022.3/openvino/**/*
input: results/cpp.sarif
output: results/cpp.sarif
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results/cpp.sarif
- name: Upload loc as a Build Artifact
uses: actions/upload-artifact@v4
with:
name: ivsr-sarif-results
path: results
retention-days: 1