Skip to content

[CODEQL] codeql workflow fix #15

[CODEQL] codeql workflow fix

[CODEQL] codeql workflow fix #15

name: "CodeQL Analysis for Anvilock"
on:
push:
branches: [ "main" ] # Trigger on push to the 'main' branch
pull_request:
branches: [ "main" ] # Trigger on pull requests to the 'main' branch
jobs:
codeql:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ "c" ] # Specify the primary language of your repo
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Run build.sh script
run: |
cd .github/workflows/
chmod +x ./build-ubuntu.sh
./build-ubuntu.sh
- name: Create CodeQL database
run: |
${{ github.workspace }}/codeql/codeql database create db --language=c
- name: Perform CodeQL Analysis
run: |
${{ github.workspace }}/codeql/codeql analyze db --format=sarif-latest --output=codeql-results.sarif
- name: Upload SARIF results
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: codeql-results.sarif