-
Notifications
You must be signed in to change notification settings - Fork 215
64 lines (54 loc) · 1.8 KB
/
Copy pathcode-analysis.yml
File metadata and controls
64 lines (54 loc) · 1.8 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
57
58
59
60
61
62
63
64
name: "CodeQL Analysis"
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '0 0 * * *'
jobs:
analyze-code:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
pull-requests: write
env:
GOPRIVATE: "github.com/onflow, github.com/axiomzen"
# ORG_READER_PAT: ${{ secrets.ORG_READER_PAT }}
# ORG_READER_USERNAME: ${{ secrets.ORG_READER_USERNAME }}
strategy:
fail-fast: false
matrix:
languages: ['go']
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: ./go.mod
- name: Install third-party vendor
run: go install github.com/nomad-software/vend@v1.0.3
# - name: set credentials for private repos
# run: rm -f ~/.gitconfig && git config --global url.https://$ORG_READER_USERNAME:$ORG_READER_PAT@github.com/.insteadOf https://github.com/ && cat ~/.gitconfig
# use a third-party vendoring tool instead of "go mod vend" because of the issue
# reported here https://github.com/golang/go/issues/26366. onflow/crypto has
# non-go files that are not copied by the Go standard tooling.
- name: Tidy Go and mod vendor
run: go mod tidy && vend
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.languages}}
queries: security-extended
- name: Build
run: go build -mod=vendor ./...
- name: CodeQL Analyze
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{ matrix.languages}}"
# need org username and pat to access private libraries