File tree Expand file tree Collapse file tree 3 files changed +70
-0
lines changed Expand file tree Collapse file tree 3 files changed +70
-0
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,38 @@ jobs:
143
143
skip-integration-tests: 1
144
144
typ: integration
145
145
146
+ govulncheck :
147
+ runs-on : ubuntu-24.04
148
+ permissions :
149
+ # required to write sarif report
150
+ security-events : write
151
+ steps :
152
+ -
153
+ name : Checkout
154
+ uses : actions/checkout@v4
155
+ with :
156
+ fetch-depth : 0
157
+ -
158
+ name : Set up Docker Buildx
159
+ uses : docker/setup-buildx-action@v3
160
+ with :
161
+ version : ${{ env.SETUP_BUILDX_VERSION }}
162
+ driver-opts : image=${{ env.SETUP_BUILDKIT_IMAGE }}
163
+ buildkitd-flags : --debug
164
+ -
165
+ name : Run
166
+ uses : docker/bake-action@v5
167
+ with :
168
+ targets : govulncheck
169
+ env :
170
+ GOVULNCHECK_FORMAT : sarif
171
+ -
172
+ name : Upload SARIF report
173
+ if : ${{ github.ref == 'refs/heads/master' && github.repository == 'moby/buildkit' }}
174
+ uses : github/codeql-action/upload-sarif@v3
175
+ with :
176
+ sarif_file : ${{ env.DESTDIR }}/govulncheck.out
177
+
146
178
image :
147
179
runs-on : ubuntu-24.04
148
180
needs :
Original file line number Diff line number Diff line change @@ -281,3 +281,18 @@ target "mod-outdated" {
281
281
no-cache-filter = [" outdated" ]
282
282
output = [" type=cacheonly" ]
283
283
}
284
+
285
+ variable "GOVULNCHECK_FORMAT" {
286
+ default = null
287
+ }
288
+
289
+ target "govulncheck" {
290
+ inherits = [" _common" ]
291
+ dockerfile = " ./hack/dockerfiles/govulncheck.Dockerfile"
292
+ target = " output"
293
+ args = {
294
+ FORMAT = GOVULNCHECK_FORMAT
295
+ }
296
+ no-cache-filter = [" run" ]
297
+ output = [" ${ DESTDIR } " ]
298
+ }
Original file line number Diff line number Diff line change
1
+ # syntax=docker/dockerfile:1
2
+
3
+ ARG GO_VERSION="1.22"
4
+ ARG GOVULNCHECK_VERSION="v1.1.3"
5
+ ARG FORMAT="text"
6
+
7
+ FROM golang:${GO_VERSION}-alpine AS base
8
+ WORKDIR /go/src/github.com/moby/buildkit
9
+ ARG GOVULNCHECK_VERSION
10
+ RUN --mount=type=cache,target=/root/.cache \
11
+ --mount=type=cache,target=/go/pkg/mod \
12
+ go install golang.org/x/vuln/cmd/govulncheck@$GOVULNCHECK_VERSION
13
+
14
+ FROM base AS run
15
+ ARG FORMAT
16
+ RUN --mount=type=bind,target=. <<EOT
17
+ set -ex
18
+ mkdir /out
19
+ govulncheck -format ${FORMAT} ./... | tee /out/govulncheck.out
20
+ EOT
21
+
22
+ FROM scratch AS output
23
+ COPY --from=run /out /
You can’t perform that action at this time.
0 commit comments