Skip to content

Add Actions.HttpClient #126

Add Actions.HttpClient

Add Actions.HttpClient #126

# CodeQL Code Scanning
# Analyses your code for security vulnerabilities and coding errors.
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository. You may wish to alter this file to override
# the set of languages analyzed, or to provide custom queries or build logic.
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/about-code-scanning
name: code analysis
on:
push:
branches: [main]
paths:
- '**.cs'
- '**.csproj'
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
paths:
- '**.cs'
- '**.csproj'
schedule:
- cron: '0 7 * * 1'
workflow_dispatch:
inputs:
reason:
description: 'The reason for running a build?'
required: true
default: 'Manual build'
jobs:
analyze:
name: analyze
runs-on: ubuntu-latest
permissions:
security-events: write
strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['csharp']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- name: 'Print manual build reason'
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
echo 'Reason: ${{ github.event.inputs.reason }}'
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# 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.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Autobuild
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3