-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Copyright 2020 Wayback Archiver. All rights reserved. | ||
# Use of this source code is governed by the MIT license | ||
# that can be found in the LICENSE file. | ||
|
||
name: CodeQL | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
language: | ||
type: string | ||
description: 'Languages used in code base' | ||
config-file: | ||
type: string | ||
description: 'Configuration file of CodeQL.' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
codeql: | ||
name: CodeQL Analysis | ||
runs-on: ubuntu-latest | ||
permissions: | ||
security-events: write | ||
actions: read | ||
contents: read | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@2e205a28d0e1da00c5f53b161f4067b052c61f34 # v1.5.0 | ||
with: | ||
egress-policy: block | ||
disable-telemetry: true | ||
allowed-endpoints: > | ||
github.com:443 | ||
api.github.com:443 | ||
uploads.github.com:443 | ||
proxy.golang.org:443 | ||
sum.golang.org:443 | ||
storage.googleapis.com:443 | ||
- name: Check out code base | ||
if: github.event_name == 'push' | ||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- name: Check out code base | ||
if: github.event_name == 'pull_request' | ||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@f0a12816612c7306b485a22cb164feb43c6df818 # v2.11.2 | ||
with: | ||
languages: ${{ inputs.language }} | ||
config-file: ${{ inputs.config-file }} | ||
# 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 | ||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, 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@f0a12816612c7306b485a22cb164feb43c6df818 # v2.11.2 | ||
|
||
# ℹ️ 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 | ||
uses: github/codeql-action/analyze@f0a12816612c7306b485a22cb164feb43c6df818 # v2.11.2 | ||
|