Skip to content

Create main.yml

Create main.yml #264

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:
pull_request:
branches: [ "main" ]
push:
branches: [ "main" ]
schedule:
- cron: '43 4 */2 * *'
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: 'ubuntu-24.04'
permissions:
security-events: write
packages: read
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}-${{ matrix.language }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
include:
- language: csharp
build-mode: manual
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
- name: Setup .NET Core SDK
uses: actions/[email protected]
if: ${{ matrix.language == 'csharp' }}
with:
dotnet-version: |
8.0.x
9.0.x
- name: Build the project
if: ${{ matrix.language == 'csharp' && matrix.build-mode == 'manual' }}
shell: bash
run: |
dotnet build -c Release SimpleCDN.sln -p:PublishAot=false
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"