Skip to content

Update codeql-analysis-csharp.yaml #10

Update codeql-analysis-csharp.yaml

Update codeql-analysis-csharp.yaml #10

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: "CodeQL C#"
on:
push:
branches: ["master", "main"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["master", "main"]
schedule:
- cron: "27 4 * * 5"
env:
DOTNET_VERSION: '6.0.x' # The .NET SDK version to use
jobs:
build:
name: build-${{ matrix.browser }}/${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
browser: [FIREFOX,CHROME]
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: "csharp"
queries: security-extended # security-and-quality
# build-mode: none
build-mode: manual
- name: Install dependencies
run: |
dotnet restore lib/PuppeteerSharp.sln
dotnet dev-certs https -ep lib/PuppeteerSharp.TestServer/testCert.cer
sudo openssl x509 -inform der -in lib/PuppeteerSharp.TestServer/testCert.cer -out /usr/local/share/ca-certificates/testCert.crt -outform pem
sudo update-ca-certificates
- name: Build
run: dotnet build lib/PuppeteerSharp.sln
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
# analyze:
# name: Analyze
# runs-on: ubuntu-latest
# permissions:
# actions: read
# contents: read
# security-events: write
# strategy:
# fail-fast: false
# matrix:
# language: ["csharp"]
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# # Initializes the CodeQL tools for scanning.
# - name: Initialize CodeQL
# uses: github/codeql-action/init@v3
# with:
# languages: ${{ matrix.language }}
# queries: security-extended # security-and-quality
# # build-mode: none
# build-mode: manual
# # If you wish to specify custom queries, you can do so here or in a config file.
# # By default, queries listed here will override any specified in a config file.
# # Prefix the list here with "+" to use these queries and those in the config file.
# # # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# # # If this step fails, then you should remove it and run the build manually (see below)
# # - name: Autobuild
# # uses: github/codeql-action/autobuild@v3
# # ℹ️ Command-line programs to run using the OS shell.
# # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# # If the Autobuild fails above, remove it and uncomment the following three lines.
# # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# # - run: |
# # echo "Run, Build Application using script"
# # ./location_of_script_within_repo/buildscript.sh
# # - name: Install dependencies
# # run: |
# # dotnet restore lib/PuppeteerSharp.sln
# # dotnet dev-certs https -ep lib/PuppeteerSharp.TestServer/testCert.cer
# # sudo openssl x509 -inform der -in lib/PuppeteerSharp.TestServer/testCert.cer -out /usr/local/share/ca-certificates/testCert.crt -outform pem
# # sudo update-ca-certificates
# # - name: Build
# # run: |
# # echo "Run, Build Application using script"
# # dotnet build lib/PuppeteerSharp.sln
# # - run: |
# # echo 'If you are using a "manual" build mode for one or more of the' \
# # 'languages you are analyzing, replace this with the commands to build' \
# # 'your code, for example:'
# # echo ' make bootstrap'
# # echo ' make release'
# # exit 1
# # dotnet build
# # MSbuild
# - name: Perform CodeQL Analysis
# uses: github/codeql-action/analyze@v3
# with:
# category: "/language:${{matrix.language}}"