-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (53 loc) · 1.93 KB
/
Copy pathcodeql.yml
File metadata and controls
56 lines (53 loc) · 1.93 KB
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
# CodeQL static analysis (Go) on the GitHub mirror -> Security tab. Satisfies OpenSSF
# Scorecard's SAST check. Actions pinned to SHAs; Renovate updates them.
name: codeql
on:
push:
branches: [main, 'ci/**'] # ci/** proves a workflow change green before it lands on main
pull_request:
branches: [main]
schedule:
- cron: '27 3 * * 1' # Mondays 03:27 UTC
workflow_dispatch: # so a run can be kicked off without inventing a commit
permissions: {}
jobs:
analyze:
name: analyze (go)
runs-on: ubuntu-latest
permissions:
security-events: write # upload CodeQL results
contents: read
actions: read
steps:
# Deny egress by default; see ci.yml. uploads.github.com is where the SARIF result goes,
# storage.googleapis.com is where setup-go falls back for a toolchain the runner has
# not cached.
- name: Harden the runner
uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0
with:
egress-policy: block
allowed-endpoints: >
api.github.com:443
github.com:443
proxy.golang.org:443
release-assets.githubusercontent.com:443
storage.googleapis.com:443
uploads.github.com:443
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: '1.26.5'
check-latest: false
- name: Initialize CodeQL
uses: github/codeql-action/init@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4.37.4
with:
languages: go
build-mode: autobuild
- name: Analyze
uses: github/codeql-action/analyze@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4.37.4
with:
category: "/language:go"