2022-12-02 02:08:48 +03:00
|
|
|
|
# Copyright 2021 OpenSSF Scorecard Authors
|
2021-04-02 05:09:45 +03:00
|
|
|
|
#
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
|
#
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
#
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
2020-12-22 16:27:02 +03:00
|
|
|
|
# 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.
|
|
|
|
|
#
|
|
|
|
|
# ******** NOTE ********
|
|
|
|
|
# We have attempted to detect the languages in your repository. Please check
|
|
|
|
|
# the `language` matrix defined below to confirm you have the correct set of
|
|
|
|
|
# supported CodeQL languages.
|
|
|
|
|
#
|
|
|
|
|
name: "CodeQL"
|
|
|
|
|
on:
|
|
|
|
|
push:
|
|
|
|
|
branches: [ main ]
|
|
|
|
|
pull_request:
|
|
|
|
|
# The branches below must be a subset of the branches above
|
|
|
|
|
branches: [ main ]
|
|
|
|
|
schedule:
|
|
|
|
|
- cron: '36 19 * * 3'
|
2022-03-30 19:11:30 +03:00
|
|
|
|
|
2021-09-07 18:52:14 +03:00
|
|
|
|
permissions:
|
|
|
|
|
contents: read
|
2020-12-22 16:27:02 +03:00
|
|
|
|
|
2024-01-31 21:54:06 +03:00
|
|
|
|
env:
|
2024-02-07 22:36:37 +03:00
|
|
|
|
GO_VERSION: 1.22
|
2024-01-31 21:54:06 +03:00
|
|
|
|
|
2020-12-22 16:27:02 +03:00
|
|
|
|
jobs:
|
|
|
|
|
analyze:
|
2022-03-28 22:59:41 +03:00
|
|
|
|
permissions:
|
|
|
|
|
actions: read # for github/codeql-action/init to get workflow details
|
|
|
|
|
contents: read # for actions/checkout to fetch code
|
|
|
|
|
security-events: write # for github/codeql-action/autobuild to send a status report
|
2020-12-22 16:27:02 +03:00
|
|
|
|
name: Analyze
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
|
fail-fast: false
|
|
|
|
|
matrix:
|
2021-09-10 02:02:11 +03:00
|
|
|
|
language: [ 'go','javascript' ]
|
2020-12-22 16:27:02 +03:00
|
|
|
|
|
|
|
|
|
steps:
|
2022-03-15 19:14:03 +03:00
|
|
|
|
- name: Harden Runner
|
2024-02-07 23:21:56 +03:00
|
|
|
|
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v1
|
2022-03-15 19:14:03 +03:00
|
|
|
|
with:
|
|
|
|
|
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
|
|
|
|
|
|
2020-12-22 16:27:02 +03:00
|
|
|
|
- name: Checkout repository
|
2024-04-24 20:59:20 +03:00
|
|
|
|
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
|
2020-12-22 16:27:02 +03:00
|
|
|
|
|
2024-01-31 21:54:06 +03:00
|
|
|
|
# don't use the default version of Go from GitHub runners
|
|
|
|
|
# https://github.com/github/codeql-action/issues/1842#issuecomment-1704398087
|
|
|
|
|
- name: Setup Go
|
|
|
|
|
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
|
|
|
|
|
with:
|
|
|
|
|
go-version: ${{ env.GO_VERSION }}
|
|
|
|
|
check-latest: true
|
|
|
|
|
cache: false # CodeQL needs to build everything itself to do its analysis
|
|
|
|
|
|
2020-12-22 16:27:02 +03:00
|
|
|
|
# Initializes the CodeQL tools for scanning.
|
|
|
|
|
- name: Initialize CodeQL
|
2024-04-24 20:59:20 +03:00
|
|
|
|
uses: github/codeql-action/init@8f596b4ae3cb3c588a5c46780b86dd53fef16c52 # v3.25.2
|
2020-12-22 16:27:02 +03:00
|
|
|
|
with:
|
|
|
|
|
languages: ${{ matrix.language }}
|
2022-03-24 22:10:12 +03:00
|
|
|
|
queries: +security-extended
|
2020-12-22 16:27:02 +03:00
|
|
|
|
# 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
|
2024-04-24 20:59:20 +03:00
|
|
|
|
uses: github/codeql-action/autobuild@8f596b4ae3cb3c588a5c46780b86dd53fef16c52 # v3.25.2
|
2020-12-22 16:27:02 +03:00
|
|
|
|
|
|
|
|
|
# ℹ️ 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
|
2024-04-24 20:59:20 +03:00
|
|
|
|
uses: github/codeql-action/analyze@8f596b4ae3cb3c588a5c46780b86dd53fef16c52 # v3.25.2
|