dotnet build with CodeQL #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: dotnet build with CodeQL | |
on: | |
workflow_call: | |
inputs: | |
build-ref: | |
required: true | |
type: string | |
workflow_dispatch: | |
schedule: # for CodeQL | |
- cron: '30 4 1 * *' # on every month's first day at 4:30 UTC | |
env: | |
DOTNET_NOLOGO: true | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
DOTNET_GENERATE_ASPNET_CERTIFICATE: false | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
permissions: | |
security-events: write # for CodeQL | |
actions: read # for CodeQL | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # avoid shallow clone so nbgv can do its work. | |
lfs: true | |
- uses: dotnet/nbgv@v0.4 | |
id: nbgv | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v3 | |
with: | |
languages: csharp | |
- run: dotnet restore | |
- run: dotnet build -c Release --no-restore | |
- run: dotnet pack -c Release --no-restore | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v3 |