Skip to content

CodeQL Advanced Scan #67

CodeQL Advanced Scan

CodeQL Advanced Scan #67

Workflow file for this run

# This workflow uses the CodeQL Action to analyze a repository for vulnerabilities.
# For more information, see the documentation at https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning
name: "CodeQL Advanced Scan"
on:
push:
branches: ["main", "feature/**"]
pull_request:
branches: ["main", "feature/**"]
schedule:
- cron: "0 0 * * *"
permissions: {} # No permissions by default on workflow level
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
security-events: write # required to publish sarif
strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
- language: python
build-mode: none
- language: javascript-typescript
build-mode: none
# FIXME: Temporary restriction: do not run for javascript-typescript, unless on push and PR for geti-inspect feature branch.
# This prevents JavaScript/TypeScript CodeQL analysis (job failure) on unrelated branches and should be removed once feature/geti-inspect will be merged into the main
steps:
- name: Harden the runner (audit all outbound calls)
if: matrix.language != 'javascript-typescript' || (github.event_name != 'schedule' && (contains(github.ref, 'feature/geti-inspect') || contains(github.base_ref, 'feature/geti-inspect')))
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit
- name: Checkout repository
if: matrix.language != 'javascript-typescript' || (github.event_name != 'schedule' && (contains(github.ref, 'feature/geti-inspect') || contains(github.base_ref, 'feature/geti-inspect')))
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
if: matrix.language != 'javascript-typescript' || (github.event_name != 'schedule' && (contains(github.ref, 'feature/geti-inspect') || contains(github.base_ref, 'feature/geti-inspect')))
uses: github/codeql-action/init@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-extended
- name: Perform CodeQL Analysis
if: matrix.language != 'javascript-typescript' || (github.event_name != 'schedule' && (contains(github.ref, 'feature/geti-inspect') || contains(github.base_ref, 'feature/geti-inspect')))
uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
with:
category: "/language:${{matrix.language}}"