Skip to content

Commit fab7faa

Browse files
authored
Merge pull request #817 from rstudio/dev
Merge `dev` to `main`
2 parents 94e8642 + 6f7c47a commit fab7faa

38 files changed

+576
-281
lines changed

.github/actions/bake-test-push/action.yml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ inputs:
1717
description: Flag to test image once built
1818
default: true
1919
type: boolean
20+
scan-image:
21+
description: Flag to scan image for vulnerabilities once built
22+
default: true
23+
type: boolean
2024
push-image:
2125
description: Flag to push image once built
2226
default: false
@@ -37,6 +41,14 @@ inputs:
3741
description: JSON for authenticating Google Cloud Platform
3842
default: ""
3943
type: string
44+
snyk-org:
45+
description: Organization ID for Snyk
46+
default: ""
47+
type: string
48+
snyk-token:
49+
description: Token for authenticating with Snyk
50+
default: ""
51+
type: string
4052

4153
runs:
4254
using: "composite"
@@ -47,6 +59,13 @@ runs:
4759
env:
4860
GITHUB_TOKEN: ${{ inputs.ghcr-token }}
4961

62+
- uses: snyk/actions/setup@master
63+
64+
- name: Snyk auth
65+
shell: bash
66+
run: |
67+
snyk auth ${{ inputs.snyk-token }}
68+
5069
- uses: actions/setup-python@v5
5170
with:
5271
python-version: '3.12'
@@ -109,7 +128,30 @@ runs:
109128
- name: Test
110129
shell: bash
111130
run: |
112-
just test "${{ inputs.target }}" "${{ inputs.bakefile }}"
131+
if [[ "${{ inputs.test-image }}" == "true" ]]; then
132+
just test "${{ inputs.target }}" "${{ inputs.bakefile }}"
133+
fi
134+
135+
- name: Scan
136+
continue-on-error: true
137+
env:
138+
SNYK_ORG: ${{ inputs.snyk-org }}
139+
shell: bash
140+
run: |
141+
if [[ "${{ inputs.scan-image }}" == "true" ]]; then
142+
if [[ "${{ inputs.push-image }}" == "true" ]]; then
143+
just snyk-monitor "${{ inputs.target }}" "${{ inputs.bakefile }}"
144+
else
145+
just snyk-test "${{ inputs.target }}" "${{ inputs.bakefile }}"
146+
fi
147+
fi
148+
149+
- name: Upload results
150+
uses: github/codeql-action/upload-sarif@v3
151+
continue-on-error: true
152+
with:
153+
sarif_file: "container.sarif"
154+
category: "${{ inputs.target }}-snyk-vulnerabilities"
113155

114156
- name: Push - ${{ inputs.push-image }}
115157
uses: docker/bake-action@v4

.github/actions/build-test-scan-push/action.yaml

Lines changed: 0 additions & 180 deletions
This file was deleted.

.github/workflows/build-bake-preview.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ jobs:
9999
ghcr-token: ${{ secrets.GITHUB_TOKEN }}
100100
dockerhub-username: ${{ secrets.DOCKER_HUB_USERNAME }}
101101
dockerhub-token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
102+
snyk-org: ${{ secrets.SNYK_ORG }}
103+
snyk-token: '${{ secrets.SNYK_TOKEN }}'
102104

103105
connect-daily:
104106
needs: [versions]
@@ -137,6 +139,8 @@ jobs:
137139
ghcr-token: ${{ secrets.GITHUB_TOKEN }}
138140
dockerhub-username: ${{ secrets.DOCKER_HUB_USERNAME }}
139141
dockerhub-token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
142+
snyk-org: ${{ secrets.SNYK_ORG }}
143+
snyk-token: '${{ secrets.SNYK_TOKEN }}'
140144

141145
connect-content-init-daily:
142146
needs: [versions]
@@ -175,6 +179,8 @@ jobs:
175179
ghcr-token: ${{ secrets.GITHUB_TOKEN }}
176180
dockerhub-username: ${{ secrets.DOCKER_HUB_USERNAME }}
177181
dockerhub-token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
182+
snyk-org: ${{ secrets.SNYK_ORG }}
183+
snyk-token: '${{ secrets.SNYK_TOKEN }}'
178184

179185
package-manager-preview:
180186
needs: [versions]
@@ -213,6 +219,8 @@ jobs:
213219
ghcr-token: ${{ secrets.GITHUB_TOKEN }}
214220
dockerhub-username: ${{ secrets.DOCKER_HUB_USERNAME }}
215221
dockerhub-token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
222+
snyk-org: ${{ secrets.SNYK_ORG }}
223+
snyk-token: '${{ secrets.SNYK_TOKEN }}'
216224

217225
package-manager-daily:
218226
needs: [versions]
@@ -251,6 +259,8 @@ jobs:
251259
ghcr-token: ${{ secrets.GITHUB_TOKEN }}
252260
dockerhub-username: ${{ secrets.DOCKER_HUB_USERNAME }}
253261
dockerhub-token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
262+
snyk-org: ${{ secrets.SNYK_ORG }}
263+
snyk-token: '${{ secrets.SNYK_TOKEN }}'
254264

255265
r-session-complete-preview:
256266
needs: [versions]
@@ -289,6 +299,8 @@ jobs:
289299
ghcr-token: ${{ secrets.GITHUB_TOKEN }}
290300
dockerhub-username: ${{ secrets.DOCKER_HUB_USERNAME }}
291301
dockerhub-token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
302+
snyk-org: ${{ secrets.SNYK_ORG }}
303+
snyk-token: '${{ secrets.SNYK_TOKEN }}'
292304

293305
r-session-complete-daily:
294306
needs: [versions]
@@ -327,6 +339,8 @@ jobs:
327339
ghcr-token: ${{ secrets.GITHUB_TOKEN }}
328340
dockerhub-username: ${{ secrets.DOCKER_HUB_USERNAME }}
329341
dockerhub-token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
342+
snyk-org: ${{ secrets.SNYK_ORG }}
343+
snyk-token: '${{ secrets.SNYK_TOKEN }}'
330344

331345
workbench-preview:
332346
needs: [versions]
@@ -365,6 +379,8 @@ jobs:
365379
ghcr-token: ${{ secrets.GITHUB_TOKEN }}
366380
dockerhub-username: ${{ secrets.DOCKER_HUB_USERNAME }}
367381
dockerhub-token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
382+
snyk-org: ${{ secrets.SNYK_ORG }}
383+
snyk-token: '${{ secrets.SNYK_TOKEN }}'
368384

369385
workbench-daily:
370386
needs: [versions]
@@ -403,3 +419,5 @@ jobs:
403419
ghcr-token: ${{ secrets.GITHUB_TOKEN }}
404420
dockerhub-username: ${{ secrets.DOCKER_HUB_USERNAME }}
405421
dockerhub-token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
422+
snyk-org: ${{ secrets.SNYK_ORG }}
423+
snyk-token: '${{ secrets.SNYK_TOKEN }}'

0 commit comments

Comments
 (0)