hercules/.github/workflows/codeql-analysis.yml
Haru d898cb5c22
Switch to codeql-action/init@v3, codeql-action/autobuild@v3, codeql-action/analyze@v3
This fixes the following deprecation warnings in GitHub Actions:

- 'The following actions use a deprecated Node.js version and will be forced to run on node20: github/codeql-action/init@v2, github/codeql-action/autobuild@v2, github/codeql-action/analyze@v2'
- 'CodeQL Action v2 will be deprecated on December 5th, 2024. Please update all occurrences of the CodeQL Action in your workflow files to v3"

Signed-off-by: Haru <haru@dotalux.com>
2024-08-31 18:49:31 +02:00

44 lines
1.3 KiB
YAML

name: "CodeQL"
on: workflow_call
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: ['c', 'python']
# github.head_ref will stop previous runs in the same PR (if in a PR)
# github.run_id is a fallback when outside a PR (e.g. every merge in master will run, and previous won't stop)
concurrency:
group: codeql-${{ github.head_ref || github.run_id }}_${{ matrix.language }}
cancel-in-progress: true
permissions:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# 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
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3