Skip to content

CodeQL (CziShrink) #350

CodeQL (CziShrink)

CodeQL (CziShrink) #350

---
name: "CodeQL (CziShrink)"
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
- cron: "30 2 * * 2"
workflow_dispatch: {}
permissions: read-all
jobs:
analyze:
name: Analyze CziShrink
defaults:
run:
working-directory: czishrink
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
- name: Get dotnet version from global.json
id: get_dotnet_version
run: |
$global_json = Get-Content -Path "./global.json" | ConvertFrom-Json
$dotnetversion = $global_json.sdk.version
"dotnetversion=$dotnetversion" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
shell: pwsh
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ steps.get_dotnet_version.outputs.dotnetversion }}
- name: Cache nugets
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.nuget/packages
key: ${{ runner.os }}-czishrink-nuget-${{ hashFiles('czishrink/**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-czishrink-nuget-
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: csharp
queries: security-and-quality
- name: Restore dependencies
run: dotnet restore --locked-mode
- name: Build
run: dotnet build --no-restore -c Release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3