2021-06-25 00:07:30 -05: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:
|
2021-10-21 13:13:14 -05:00
|
|
|
|
branches: [ main ]
|
2021-06-25 00:07:30 -05:00
|
|
|
|
pull_request:
|
|
|
|
|
# The branches below must be a subset of the branches above
|
2021-10-21 13:13:14 -05:00
|
|
|
|
branches: [ main ]
|
2021-06-25 00:07:30 -05:00
|
|
|
|
schedule:
|
|
|
|
|
- cron: '17 11 * * 0'
|
|
|
|
|
|
2022-07-16 18:22:38 -05:00
|
|
|
|
permissions: read-all
|
|
|
|
|
|
2021-06-25 00:07:30 -05:00
|
|
|
|
jobs:
|
|
|
|
|
analyze:
|
|
|
|
|
name: Analyze
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
permissions:
|
|
|
|
|
actions: read
|
|
|
|
|
contents: read
|
|
|
|
|
security-events: write
|
|
|
|
|
strategy:
|
|
|
|
|
fail-fast: false
|
|
|
|
|
matrix:
|
|
|
|
|
language: [ 'go' ]
|
|
|
|
|
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
|
|
|
|
# Learn more:
|
|
|
|
|
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
2022-04-26 12:15:53 -05:00
|
|
|
|
env:
|
|
|
|
|
CGO_ENABLED: 0
|
2022-10-10 07:05:55 -05:00
|
|
|
|
GOFLAGS: "-tags=sync,search,scrub,metrics,containers_image_openpgp"
|
2021-06-25 00:07:30 -05:00
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- name: Checkout repository
|
2022-07-13 16:15:33 -05:00
|
|
|
|
uses: actions/checkout@v3
|
2021-06-25 00:07:30 -05:00
|
|
|
|
|
2022-04-26 12:15:53 -05:00
|
|
|
|
- name: Install go
|
2022-07-13 16:15:33 -05:00
|
|
|
|
uses: actions/setup-go@v3
|
2022-04-26 12:15:53 -05:00
|
|
|
|
with:
|
2022-10-05 05:21:14 -05:00
|
|
|
|
go-version: 1.19.x
|
2022-04-26 12:15:53 -05:00
|
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
|
run: |
|
|
|
|
|
cd $GITHUB_WORKSPACE
|
|
|
|
|
go install github.com/swaggo/swag/cmd/swag@latest
|
|
|
|
|
go mod download
|
|
|
|
|
go install github.com/wadey/gocovmerge@latest
|
|
|
|
|
go get -u github.com/swaggo/swag/cmd/swag
|
|
|
|
|
go mod download
|
|
|
|
|
sudo apt-get update
|
|
|
|
|
sudo apt-get -y install rpm uidmap
|
|
|
|
|
# install skopeo
|
|
|
|
|
. /etc/os-release
|
|
|
|
|
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
|
|
|
|
|
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key | sudo apt-key add -
|
|
|
|
|
sudo apt-get update
|
|
|
|
|
sudo apt-get -y upgrade
|
|
|
|
|
sudo apt-get -y install skopeo
|
|
|
|
|
# install notation
|
|
|
|
|
curl -Lo notation.tar.gz https://github.com/notaryproject/notation/releases/download/v0.7.1-alpha.1/notation_0.7.1-alpha.1_linux_amd64.tar.gz
|
|
|
|
|
sudo tar xvzf notation.tar.gz -C /usr/bin notation
|
|
|
|
|
# install oras
|
2022-08-30 11:29:39 -05:00
|
|
|
|
curl -LO https://github.com/oras-project/oras/releases/download/v0.14.0/oras_0.14.0_linux_amd64.tar.gz
|
2022-04-26 12:15:53 -05:00
|
|
|
|
mkdir -p oras-install/
|
2022-08-30 11:29:39 -05:00
|
|
|
|
tar -zxf oras_0.14.0_*.tar.gz -C oras-install/
|
2022-04-26 12:15:53 -05:00
|
|
|
|
sudo mv oras-install/oras /usr/bin/
|
2022-08-30 11:29:39 -05:00
|
|
|
|
rm -rf oras_0.14.0_*.tar.gz oras-install/
|
2022-04-26 12:15:53 -05:00
|
|
|
|
|
2021-06-25 00:07:30 -05:00
|
|
|
|
# Initializes the CodeQL tools for scanning.
|
|
|
|
|
- name: Initialize CodeQL
|
2022-04-26 12:15:53 -05:00
|
|
|
|
uses: github/codeql-action/init@v2
|
2021-06-25 00:07:30 -05:00
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
# 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
|
2022-04-26 12:15:53 -05:00
|
|
|
|
uses: github/codeql-action/autobuild@v2
|
2021-06-25 00:07:30 -05: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
|
2022-04-26 12:15:53 -05:00
|
|
|
|
uses: github/codeql-action/analyze@v2
|