Skip to content

Commit 8fffce9

Browse files
internal: add CVE check to release job as blocking (#171)
### Description internal: add CVE check to release job as blocking ### Checklist - [ ] Created tests which fail without the change (if possible) - [ ] Extended the README / documentation, if necessary
1 parent 177be9a commit 8fffce9

File tree

2 files changed

+36
-16
lines changed

2 files changed

+36
-16
lines changed

.github/workflows/release.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ permissions:
1414
contents: write
1515

1616
jobs:
17+
vuln-check:
18+
name: Docker Image Vulnerability Check
19+
uses: ./.github/workflows/vuln-check.yaml
20+
secrets: inherit
21+
1722
goreleaser:
23+
needs: vuln-check
1824
runs-on: ubuntu-observe-agent-8cpu
1925
steps:
2026
- name: Checkout

.github/workflows/vuln-check.yaml

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Docker Image Vulnerability Check
22

33
on:
44
workflow_dispatch:
5+
workflow_call:
56

67
permissions:
78
contents: read
@@ -10,33 +11,45 @@ env:
1011
TEST_TAG: observeinc/observe-agent:test
1112

1213
jobs:
13-
build:
14-
runs-on: ubuntu-latest
14+
vuln-check:
15+
runs-on: ubuntu-observe-agent-8cpu
1516
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
ref: ${{ github.event.inputs.branch }}
22+
1623
- name: Login to Docker Hub
1724
uses: docker/login-action@v3
1825
with:
1926
username: ${{ secrets.DOCKERHUB_USERNAME }}
2027
password: ${{ secrets.DOCKERHUB_TOKEN }}
2128

22-
- name: Install qemu
23-
uses: docker/setup-qemu-action@v3
24-
2529
- name: Set up Docker Buildx
2630
uses: docker/setup-buildx-action@v3
27-
28-
- name: Build and export
29-
uses: docker/build-push-action@v6
31+
32+
- name: Set up Go
33+
uses: actions/setup-go@v5
3034
with:
31-
tags: ${{ env.TEST_TAG }}
32-
outputs: type=docker,dest=${{ runner.temp }}/myimage.tar
35+
go-version: 1.22.12
3336

34-
- name: Upload artifact
35-
uses: actions/upload-artifact@v4
37+
- name: Run GoReleaser
38+
uses: goreleaser/goreleaser-action@v6
3639
with:
37-
name: myimage
38-
path: ${{ runner.temp }}/myimage.tar
39-
40+
distribution: goreleaser-pro
41+
version: 2.4.4
42+
args: build --snapshot --id=default --skip=validate --single-target
43+
env:
44+
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
45+
46+
- name: Copy Binary
47+
run: |
48+
cp dist/linux_amd64_v1/default_linux_amd64_v1/observe-agent .
49+
50+
- name: Build an image from Dockerfile
51+
run: docker build -f packaging/docker/Dockerfile -t docker.io/${{ env.TEST_TAG}} .
52+
4053
- name: Docker Scout
4154
id: docker-scout
4255
uses: docker/scout-action@v1
@@ -46,4 +59,5 @@ jobs:
4659
to-latest: true
4760
ignore-base: true
4861
ignore-unchanged: true
49-
only-fixed: true
62+
only-fixed: false
63+
exit-code: true

0 commit comments

Comments
 (0)