-
-
Notifications
You must be signed in to change notification settings - Fork 12
80 lines (76 loc) · 2.23 KB
/
analysis-codeql.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: "CodeQL Analysis"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '38 13 * * 4'
permissions:
contents: read
env:
MAGEARGS: -d build/magefiles -w .
TARGETPLATFORM: linux/amd64
jobs:
codeql:
name: Analyze Go
runs-on: 'ubuntu-22.04'
permissions:
security-events: write
packages: read
actions: read
strategy:
fail-fast: false
matrix:
include:
- language: go
build-mode: manual
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: block
allowed-endpoints: >
github.com:443
azure.archive.ubuntu.com:80
esm.ubuntu.com:443
ghcr.io:443
api.github.com:443
github.com:443
golang.org:443
motd.ubuntu.com:443
objects.githubusercontent.com:443
packages.microsoft.com:443
pkg-containers.githubusercontent.com:443
proxy.golang.org:443
raw.githubusercontent.com:443
storage.googleapis.com:443
uploads.github.com:443
- name: Checkout repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
with:
fetch-depth: 0
- name: Setup Go
id: setup_go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
with:
go-version-file: 'go.mod'
- name: Install Mage
uses: magefile/mage-action@6a5dcb5fe61f43d7c08a98bc3cf9bc63c308c08e # v3
with:
install-only: true
- name: Install build deps
run: mage ${MAGEARGS} preps:deps
- name: Initialize CodeQL
uses: github/codeql-action/init@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
packs: githubsecuritylab/codeql-${{ matrix.language }}-queries
- if: matrix.build-mode == 'manual'
name: Build
run: go build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
with:
category: "/language:${{matrix.language}}"