Skip to content

Commit 32d1c6c

Browse files
authored
[chore][CI] Fix snyk vulnerability scan on arm (#6080)
* Fix snyk vulnerability scan on arm * Better msg if token is not available * Try arch instead of 'latest' * Restore latest instead of arch * Append v8 to arm platform * Bring back qemu for snyk
1 parent ebc4494 commit 32d1c6c

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

.github/workflows/vuln-scans.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
path: "."
5151

5252
docker-otelcol:
53-
runs-on: ${{ fromJSON('["ubuntu-20.04", "otel-arm64"]')[matrix.ARCH == 'arm64'] }}
53+
runs-on: ubuntu-24.04${{ matrix.ARCH == 'arm64' && '-arm' || '' }}
5454
strategy:
5555
matrix:
5656
ARCH: [ "amd64", "arm64" ]
@@ -209,6 +209,8 @@ jobs:
209209
echo "defined=true" >> $GITHUB_OUTPUT
210210
else
211211
echo "defined=false" >> $GITHUB_OUTPUT
212+
echo "ERROR: The Snyk token is not available. The token is not available on PRs triggered from forked repositories."
213+
exit 1
212214
fi
213215
214216
snyk-fs-scan:
@@ -231,7 +233,7 @@ jobs:
231233
sarif_file: snyk.sarif
232234

233235
snyk-docker-scan:
234-
runs-on: ${{ matrix.ARCH == 'amd64' && 'ubuntu-24.04' || 'ubuntu-24.04-arm' }}
236+
runs-on: ubuntu-24.04
235237
needs: [docker-otelcol, check-snyk-token]
236238
if: ${{ needs.check-snyk-token.outputs.has-snyk-token == 'true' }}
237239
strategy:
@@ -241,6 +243,15 @@ jobs:
241243
fail-fast: false
242244
steps:
243245
- uses: actions/checkout@v4
246+
247+
# There is no snyk/snyk:docker image for arm64, so we need to use the
248+
# docker setup-qemu-action to run the scan
249+
- uses: docker/setup-qemu-action@v3
250+
if: ${{ matrix.ARCH != 'amd64' }}
251+
with:
252+
platforms: ${{ matrix.ARCH }}
253+
image: tonistiigi/binfmt:qemu-v7.0.0
254+
244255
- uses: actions/download-artifact@v4
245256
with:
246257
name: otelcol-${{ matrix.ARCH }}${{ matrix.FIPS == true && '-fips' || '' }}

0 commit comments

Comments
 (0)