Skip to content

Commit ec0bae8

Browse files
committed
Attempt to generate SBOM and Provenance artifacts
1 parent a193a71 commit ec0bae8

File tree

4 files changed

+54
-23
lines changed

4 files changed

+54
-23
lines changed

.github/workflows/build-test.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ jobs:
1919
steps:
2020
- name: Checkout code
2121
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
22+
2223
- name: Setup Golang
2324
uses: actions/setup-go@v5
2425
with:
2526
go-version-file: go.mod
27+
2628
- name: Run golangci-lint
2729
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
2830
with:
@@ -34,6 +36,10 @@ jobs:
3436
runs-on: ubuntu-latest
3537
name: Run govulncheck
3638
steps:
39+
# We only need to checkout as govuln does the go setup...
40+
- name: Checkout code
41+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
42+
3743
- id: govulncheck
3844
uses: golang/govulncheck-action@v1
3945
with:
@@ -45,8 +51,9 @@ jobs:
4551
runs-on: ubuntu-latest
4652
steps:
4753
- name: Checkout code
48-
uses: actions/checkout@v4 # v3.5.3
49-
- name: Setup Go
54+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
55+
56+
- name: Setup Golang
5057
uses: actions/setup-go@v5
5158
with:
5259
go-version-file: go.mod
@@ -88,13 +95,15 @@ jobs:
8895
steps:
8996
- name: Checkout code
9097
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
98+
9199
- name: Set up QEMU
92100
uses: docker/setup-qemu-action@v3
93101

94102
- name: Set up Docker Buildx
95103
uses: docker/setup-buildx-action@v3
96104
with:
97105
platforms: ${{ matrix.platform }}
106+
driver: docker-container
98107

99108
- name: Build Images
100109
uses: docker/build-push-action@v6
@@ -106,6 +115,9 @@ jobs:
106115
tags: quay.io/jetstack/version-checker:${{github.sha}}
107116
cache-from: type=gha
108117
cache-to: type=gha,mode=max
118+
attests: |-
119+
type=sbom,generator=image
120+
type=provenance,mode=max
109121
110122
- name: Run Trivy vulnerability scanner
111123
uses: aquasecurity/trivy-action@0.30.0

.github/workflows/helm-docs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ on:
44
workflow_call:
55
push:
66
paths:
7-
- '!*.md'
8-
- 'deploy/charts/version-checker/**'
7+
- "!*.md"
8+
- "deploy/charts/version-checker/**"
99
branches:
1010
- main
1111

.github/workflows/helm-test.yaml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: Test Helm Chart
22
on:
33
pull_request:
44
paths:
5-
- '!*.md'
6-
- 'deploy/charts/version-checker/**'
5+
- "!*.md"
6+
- "deploy/charts/version-checker/**"
77
branches:
8-
- 'main'
8+
- "main"
99

1010
concurrency:
1111
group: ${{ github.workflow }}-${{ github.ref }}
@@ -14,14 +14,19 @@ concurrency:
1414
jobs:
1515
lint:
1616
permissions:
17-
contents: read # for actions/checkout to fetch code
18-
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
17+
contents: read # for actions/checkout to fetch code
18+
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
1919
name: Lint Helm Chart
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: Checkout code
2323
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
2424

25+
- name: Setup Golang
26+
uses: actions/setup-go@v5
27+
with:
28+
go-version-file: go.mod
29+
2530
- uses: azure/setup-helm@v4
2631

2732
- run: helm lint deploy/charts/version-checker
@@ -33,9 +38,12 @@ jobs:
3338
- name: Checkout code
3439
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3540

36-
- uses: azure/setup-helm@v4
41+
- name: Setup Golang
42+
uses: actions/setup-go@v5
3743
with:
38-
token: ${{ github.token }}
44+
go-version-file: go.mod
45+
46+
- uses: azure/setup-helm@v4
3947

4048
- name: Install helm Plugins
4149
run: |
@@ -57,7 +65,9 @@ jobs:
5765
steps:
5866
- name: Checkout code
5967
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
68+
6069
- name: Install Kyverno CLI
6170
uses: kyverno/action-install-cli@v0.2.0
62-
- uses: azure/setup-helm@v4
63-
- run: kyverno apply -p https://github.com/kyverno/policies/pod-security/restricted --git-branch main --resource <(helm template deploy/charts/version-checker/)
71+
72+
- run: |-
73+
kyverno apply -p https://github.com/kyverno/policies/pod-security/restricted --git-branch main --resource <(helm template deploy/charts/version-checker/)

.github/workflows/release.yaml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,19 @@ jobs:
1515
prepare-release:
1616
# Don't push back to a tag!
1717
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
18-
name: Prepair release
18+
name: Prepare release
1919
runs-on: ubuntu-latest
2020
permissions:
2121
pull-requests: write
2222
contents: write
2323
steps:
24-
- uses: actions/checkout@v4
24+
- name: Checkout code
25+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
26+
- name: Setup Golang
27+
uses: actions/setup-go@v5
2528
with:
26-
fetch-depth: 0
29+
go-version-file: go.mod
30+
2731
- uses: bhowell2/github-substring-action@1.0.2
2832
id: release_number
2933
with:
@@ -113,10 +117,8 @@ jobs:
113117
helm-release:
114118
runs-on: ubuntu-latest
115119
steps:
116-
# Checkout our Repo
117-
- uses: actions/checkout@v4
118-
with:
119-
path: version-checker
120+
- name: Checkout code
121+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
120122

121123
- name: checkout jetstack-charts
122124
uses: actions/checkout@v4
@@ -134,6 +136,9 @@ jobs:
134136
run: |
135137
helm package version-checker/deploy/charts/version-checker -d jetstack-charts/charts/
136138
139+
- name: Login to Quay.io
140+
run: echo "${{ secrets.QUAY_ROBOT_TOKEN }}" | helm registry login quay.io -u ${{ secrets.QUAY_USERNAME }} --password-stdin
141+
137142
- name: Creating PR
138143
if: startsWith(github.ref, 'refs/tags/')
139144
uses: peter-evans/create-pull-request@v7
@@ -149,10 +154,16 @@ jobs:
149154
base: main
150155
draft: ${{ !startsWith(github.ref, 'refs/tags/') }}
151156

157+
- name: Push to Quay
158+
run: |-
159+
helm push jetstack-charts/charts/version-checker-${{ github.ref_name }}.tgz oci://quay.io/quay.io/jetstack/version-checker/chart
160+
152161
docker-release:
153162
runs-on: ubuntu-latest
154163
steps:
155-
- uses: actions/checkout@v4
164+
- name: Checkout code
165+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
166+
156167
- name: Set up QEMU
157168
uses: docker/setup-qemu-action@v3
158169

@@ -185,8 +196,6 @@ jobs:
185196
contents: write
186197
runs-on: ubuntu-latest
187198
steps:
188-
- uses: actions/checkout@v4
189-
190199
- name: Create Release / Change Logs
191200
uses: softprops/action-gh-release@v2
192201
with:

0 commit comments

Comments
 (0)