Files
code-coverage-summary/.github/workflows/codeql-scan.yml

74 lines
2.3 KiB
YAML

name: CodeQL Scan
on:
push:
branches: [ "master" ]
paths-ignore:
- '**/*.md'
- '**/*.gitignore'
- '**/*.gitattributes'
pull_request:
branches: [ "master" ]
schedule:
- cron: '15 5 * * 5'
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
env:
DOTNET_NOLOGO: true # Disable the .NET logo in the console output
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable the .NET first time experience to skip caching NuGet packages and speed up the build
DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry to Microsoft
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'csharp' ]
steps:
- name: Harden Runner
uses: step-security/harden-runner@74b568e8591fbb3115c70f3436a0c6b0909a8504
with:
egress-policy: block
allowed-endpoints: >
api.github.com:443
api.nuget.org:443
dotnetbuilds.azureedge.net:443
dotnetcli.azureedge.net:443
dotnetcli.blob.core.windows.net:443
github.com:443
uploads.github.com:443
- name: Checkout repository
uses: actions/checkout@d0651293c4a5a52e711f25b41b05b2212f385d28
- name: Initialize CodeQL
uses: github/codeql-action/init@74e8f231851deb9b54c3e408f88638dd39727868
with:
languages: ${{ matrix.language }}
# queries: security-extended,security-and-quality # https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
- name: Setup .Net
uses: actions/setup-dotnet@c0d4ad69d8bd405d234f1c9166d383b7a4f69ed8
with:
dotnet-version: 6.0.x
- name: Restore Dependencies
run: dotnet restore src/CodeCoverageSummary.sln
- name: Build CodeCoverageSummary
run: dotnet build src/CodeCoverageSummary.sln --configuration Release --no-restore /p:UseSharedCompilation=false
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@74e8f231851deb9b54c3e408f88638dd39727868