1+ # Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ name : Go Vulnerability Check
16+
17+ on :
18+ push :
19+ branches :
20+ - main
21+ - " pull-request/[0-9]+"
22+ paths-ignore :
23+ - ' **/*.md'
24+ - ' docs/**'
25+ - ' LICENSE'
26+ - ' .github/ISSUE_TEMPLATE/**'
27+ - ' .github/*.yaml'
28+ - ' .github/*.yml'
29+ - ' .github/headers/**'
30+ tags :
31+ - ' v*'
32+ workflow_dispatch :
33+ schedule :
34+ - cron : ' 0 6 * * *'
35+
36+ concurrency :
37+ group : ${{ github.workflow }}-${{ github.ref }}
38+ cancel-in-progress : ${{ github.ref != 'refs/heads/main' }}
39+
40+ permissions :
41+ contents : read
42+ security-events : write
43+ pull-requests : write
44+
45+ jobs :
46+ govulncheck :
47+ runs-on : ubuntu-latest
48+ timeout-minutes : 30
49+ strategy :
50+ fail-fast : false
51+ matrix :
52+ include :
53+ - component : data-models
54+ - component : commons
55+ - component : platform-connectors
56+ - component : store-client-sdk
57+ - component : health-events-analyzer
58+ - component : fault-quarantine-module
59+ - component : fault-remediation-module
60+ - component : labeler-module
61+ - component : node-drainer-module
62+ - component : janitor
63+ - component : syslog-health-monitor
64+ path : health-monitors/syslog-health-monitor
65+ - component : csp-health-monitor
66+ path : health-monitors/csp-health-monitor
67+ - component : tests
68+ - component : simple-health-client
69+ path : tilt/simple-health-client
70+ steps :
71+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
72+
73+ - name : Setup build environment
74+ uses : ./.github/actions/setup-ci-env
75+
76+ - name : Run govulncheck
77+ uses : golang/govulncheck-action@62ad9673df2c2c40aa21cb7fde77b30c3fd9c5d1 # v1.0.4
78+ with :
79+ go-package : ./${{ matrix.path || matrix.component }}
80+ work-dir : ${{ matrix.path || matrix.component }}
81+
82+ - name : Post results to PR
83+ if : failure() && startsWith(github.ref, 'refs/heads/pull-request/')
84+ run : |
85+ PR_NUM="${{ github.ref }}"
86+ PR_NUM="${PR_NUM##*/}"
87+ echo "🚨 **Vulnerabilities found in ${{ matrix.component }}**" | gh pr comment "$PR_NUM" --body-file=-
88+ env :
89+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments