gha: run CodeQL scan on pull requests

CodeQL should run on pull requests to avoid post-merge surprises.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
This commit is contained in:
Kazuyoshi Kato 2021-12-17 18:28:49 +00:00
parent 62a4e7020d
commit 8c194d8f3d

View File

@ -2,11 +2,13 @@ name: "CodeQL Scan"
on: on:
push: push:
schedule: branches:
- cron: '0 0 * * 0' - main
- 'release/**'
pull_request: pull_request:
paths: branches:
- '.github/workflows/codeql.yml' - main
- 'release/**'
jobs: jobs:
CodeQL-Build: CodeQL-Build:
@ -22,6 +24,10 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.17.5
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v1 uses: github/codeql-action/init@v1
@ -29,21 +35,9 @@ jobs:
# with: # with:
# languages: go, javascript, csharp, python, cpp, java # languages: go, javascript, csharp, python, cpp, java
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - run: |
# If this step fails, then you should remove it and run the build manually (see below). sudo apt-get install -y libseccomp-dev libbtrfs-dev
- name: Autobuild make
uses: github/codeql-action/autobuild@v1
# 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
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1 uses: github/codeql-action/analyze@v1