Skip to content

codeql

codeql #14

Workflow file for this run

name: codeql
on:
push:
branches: [ main ]
pull_request:
branches:
- main
- dotnet-vnext
- dotnet-nightly
schedule:
- cron: '0 6 * * MON'
workflow_dispatch:
permissions: {}
jobs:
analysis:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'actions', 'csharp' ]
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
filter: 'tree:0'
show-progress: false
- name: Initialize CodeQL
uses: github/codeql-action/init@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
with:
build-mode: none
languages: ${{ matrix.language }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
with:
category: /language:${{ matrix.language }}
codeql:
if: ${{ !cancelled() }}
needs: [ analysis ]
runs-on: ubuntu-latest
steps:
- name: Report status
shell: bash
env:
SCAN_SUCCESS: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
run: |
if [ "${SCAN_SUCCESS}" == "true" ]
then
echo 'CodeQL analysis successful ✅'
else
echo '::error title=CodeQL::CodeQL analysis failed ❌'
exit 1
fi