-
Notifications
You must be signed in to change notification settings - Fork 53
61 lines (52 loc) · 1.9 KB
/
codeql-analysis.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
# For more infomation, please visit: https://github.com/github/codeql-action
name: "CodeQL"
on:
push:
branches:
- 'master'
- '202[0-9][0-9][0-9]'
pull_request_target:
branches:
- 'master'
- '202[0-9][0-9][0-9]'
workflow_dispatch:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'go' ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Checkout sonic-mgmt-common repository which is used by sonic-gnmi
- name: Checkout sonic-mgmt-common repository
uses: actions/checkout@v3
with:
repository: sonic-net/sonic-mgmt-common
path: sonic-mgmt-common
# Checkout the branch that is being merged into
# This workflow has been audited, and no secrets or untrusted code are exposed to the pull_request_target trigger.
# nosemgrep: yaml.github-actions.security.pull-request-target-code-checkout.pull-request-target-code-checkout
ref: ${{ github.event.pull_request.base.ref }}
# Update go.mod to use local sonic-mgmt-common.
# This is the same hack used in the CI pipeline. See lgtm.yml.
# We should find a better way to do this.
- name: Update go.mod for sonic-mgmt-common
run: sed --debug -i 's@replace github.com/Azure/sonic-mgmt-common => ../sonic-mgmt-common@replace github.com/Azure/sonic-mgmt-common => ./sonic-mgmt-common@g' go.mod
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/[email protected]
with:
config-file: ./.github/codeql/codeql-config.yml
languages: ${{ matrix.language }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/[email protected]
with:
category: "/language:${{matrix.language}}"