Skip to content

Commit

Permalink
Updating GitHub Code Scanning Workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Jan 8, 2025
1 parent bed5ad0 commit 037d8fa
Showing 1 changed file with 40 additions and 107 deletions.
147 changes: 40 additions & 107 deletions .github/workflows/codeql-analysis-csharp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,118 +11,51 @@ on:
schedule:
- cron: "27 4 * * 5"

env:
DOTNET_VERSION: '6.0.x' # The .NET SDK version to use

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

build:

name: build-${{ matrix.browser }}/${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
browser: [FIREFOX,CHROME]
language: ["csharp"]

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}}"
- 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
# 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: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

0 comments on commit 037d8fa

Please sign in to comment.