Skip to content

Commit 62aeb19

Browse files
authored
Merge branch 'kubernetes-sigs:main' into main
2 parents f6fd747 + a1fef04 commit 62aeb19

27 files changed

+230
-146
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,13 @@ updates:
3131
update-types:
3232
- "minor"
3333
- "patch"
34+
35+
- package-ecosystem: "docker"
36+
directory: "/"
37+
schedule:
38+
interval: "weekly"
39+
groups:
40+
all:
41+
update-types:
42+
- "minor"
43+
- "patch"

.github/workflows/docs.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: github pages
2-
permissions:
3-
contents: write
2+
43
on:
54
push:
65
paths:
@@ -9,11 +8,17 @@ on:
98
branches:
109
- main # Set a branch to deploy
1110

11+
permissions: {}
12+
1213
jobs:
1314
deploy:
1415
runs-on: ubuntu-latest
16+
17+
permissions:
18+
contents: write
19+
1520
steps:
16-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1722
with:
1823
submodules: true # Fetch Hugo themes (true OR recursive)
1924
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
@@ -28,6 +33,6 @@ jobs:
2833
run: cd docs && npm install && hugo --minify
2934

3035
- name: Deploy 🚀
31-
uses: JamesIves/github-pages-deploy-action@15de0f09300eea763baee31dff6c6184995c5f6a # v4.7.2
36+
uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4.7.3
3237
with:
3338
folder: ./docs/public # The folder the action should deploy.

.github/workflows/release.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
tags:
66
- 'v*'
77

8+
permissions: {}
9+
810
jobs:
911
release:
1012
runs-on: ubuntu-latest
@@ -18,23 +20,27 @@ jobs:
1820

1921
steps:
2022
- name: Check out code
21-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
24+
25+
- name: Extract version of Go to use
26+
run: echo "GOVERSION=$(awk -F'[:@]' '/FROM golang/{print $2; exit}' Dockerfile.dev)" >> $GITHUB_ENV
2227

23-
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
28+
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
2429
with:
25-
go-version: '1.24'
30+
go-version: '${{ env.GOVERSION }}'
2631
check-latest: true
32+
cache: false
2733

2834
- name: Install cosign
29-
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0
35+
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
3036

3137
- name: Install GoReleaser
32-
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
38+
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
3339
with:
3440
install-only: true
3541

3642
- name: Run Mage
37-
uses: magefile/mage-action@6a5dcb5fe61f43d7c08a98bc3cf9bc63c308c08e # v3.0.0
43+
uses: magefile/mage-action@6f50bbb8ea47d56e62dee92392788acbc8192d0b # v3.1.0
3844
with:
3945
version: latest
4046
args: buildBinaries
@@ -53,20 +59,20 @@ jobs:
5359

5460
steps:
5561
- name: Check out code
56-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
62+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5763

5864
- name: Set tag output
5965
id: tag
6066
run: echo "tag_name=${GITHUB_REF#refs/*/}" >> "$GITHUB_OUTPUT"
6167

6268
- name: Install tejolote
63-
uses: kubernetes-sigs/release-actions/setup-tejolote@a69972745f85aab4ba5d6c681e2a0e7f73eaff2b # v0.3.0
69+
uses: kubernetes-sigs/release-actions/setup-tejolote@8af7b2a5596dff526de9db59b2c4b8457e9f52a1 # v0.4.0
6470

6571
- run: |
6672
tejolote attest --artifacts github://kubernetes-sigs/bom/${{ steps.tag.outputs.tag_name }} github://kubernetes-sigs/bom/"${GITHUB_RUN_ID}" --output bom.intoto.json --sign
6773
6874
- name: Release
69-
uses: softprops/action-gh-release@7b4da11513bf3f43f9999e90eabced41ab8bb048 # v0.1.15
75+
uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090 # v2.4.1
7076
with:
7177
files: bom.intoto.json
7278
tag_name: "${{ steps.tag.outputs.tag_name }}"

.github/workflows/snapshot.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,45 @@ on:
55
branches:
66
- 'main'
77
pull_request:
8+
branches:
9+
- 'main'
10+
11+
permissions: {}
812

913
jobs:
1014
snapshot:
1115
runs-on: ubuntu-latest
1216

17+
permissions:
18+
contents: read
19+
1320
steps:
1421
- name: Check out code onto GOPATH
15-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
23+
with:
24+
persist-credentials: false
25+
26+
- name: Extract version of Go to use
27+
run: echo "GOVERSION=$(awk -F'[:@]' '/FROM golang/{print $2; exit}' Dockerfile.dev)" >> $GITHUB_ENV
1628

17-
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
29+
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
1830
with:
19-
go-version: '1.24'
31+
go-version: '${{ env.GOVERSION }}'
2032
check-latest: true
33+
cache: false
2134

2235
- name: Install GoReleaser
23-
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
36+
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
2437
with:
2538
install-only: true
2639

2740
- name: Run Mage
28-
uses: magefile/mage-action@6a5dcb5fe61f43d7c08a98bc3cf9bc63c308c08e # v3.0.0
41+
uses: magefile/mage-action@6f50bbb8ea47d56e62dee92392788acbc8192d0b # v3.1.0
2942
with:
3043
version: latest
3144
args: buildBinariesSnapshot
3245

3346
- name: check binary
3447
run: |
35-
./dist/bom-amd64-linux version
48+
./dist/bom_linux_amd64_v1/bom version
3649
cat ./dist/bom.json.spdx

.github/workflows/verify-spdx.yaml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,54 @@ name: Validate SPDX Conformance
22

33
on:
44
pull_request:
5-
branches: ['main']
5+
branches:
6+
- 'main'
7+
8+
permissions: {}
69

710
jobs:
811
check-spdx:
912
name: Check SPDX SBOMs
1013
runs-on: ubuntu-latest
14+
15+
permissions:
16+
contents: read
17+
1118
steps:
12-
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v3.3.0
19+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
20+
with:
21+
persist-credentials: false
22+
23+
- name: Extract version of Go to use
24+
run: echo "GOVERSION=$(awk -F'[:@]' '/FROM golang/{print $2; exit}' Dockerfile.dev)" >> $GITHUB_ENV
25+
26+
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
1327
with:
14-
go-version: '1.24'
28+
go-version: '${{ env.GOVERSION }}'
1529
check-latest: true
30+
cache: false
1631

17-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1832
- run: |
1933
go run ./cmd/bom/main.go generate -i registry.k8s.io/pause > example-image-pause.spdx
2034
go run ./cmd/bom/main.go generate --format=json -i registry.k8s.io/pause > example-image-pause.spdx.json
2135
22-
- uses: chainguard-dev/actions/setup-spdx@d886686603afb809f7ef9b734b333e20b7ce5cda
36+
- uses: chainguard-dev/actions/setup-spdx@1b32103f5aa389c31ab0be75a8edc38d7e4750d8 # v1.5.7
2337
with:
2438
spdx-tools-version: 1.1.8
2539

26-
- uses: chainguard-dev/actions/setup-spdx@d886686603afb809f7ef9b734b333e20b7ce5cda
40+
- uses: chainguard-dev/actions/setup-spdx@1b32103f5aa389c31ab0be75a8edc38d7e4750d8 # v1.5.7
2741
with:
2842
download: false
2943
spdx-tools-version: 1.1.8
3044
sbom-path: example-image-pause.spdx
3145

32-
- uses: chainguard-dev/actions/setup-spdx@d886686603afb809f7ef9b734b333e20b7ce5cda
46+
- uses: chainguard-dev/actions/setup-spdx@1b32103f5aa389c31ab0be75a8edc38d7e4750d8 # v1.5.7
3347
with:
3448
download: false
3549
spdx-tools-version: 1.1.8
3650
sbom-path: example-image-pause.spdx.json
3751

38-
- uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
52+
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
3953
if: ${{ always() }}
4054
with:
4155
name: Example SBOMs

.goreleaser.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ gomod:
1616

1717
builds:
1818
- id: bom
19-
no_unique_dist_dir: true
20-
binary: bom-{{ .Arch }}-{{ .Os }}
2119
main: ./cmd/bom
2220
goos:
2321
- darwin
@@ -48,6 +46,7 @@ builds:
4846
archives:
4947
- formats:
5048
- binary
49+
name_template: "{{ .ProjectName }}-{{ .Arch }}-{{ .Os }}"
5150
allow_different_binary_count: true
5251

5352
signs:
@@ -61,7 +60,7 @@ signs:
6160

6261
sboms:
6362
- id: bom
64-
cmd: ./bom-amd64-linux
63+
cmd: ./bom_linux_amd64_v1/bom
6564
args:
6665
- generate
6766
- "--output"

Dockerfile.dev

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#
2+
# Copyright 2025 The Kubernetes Authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
# This is used to we scrap the go version and use in CI to get the latest go version
18+
# and we use dependabot to keep the go version up to date
19+
FROM golang:1.25.3

cloudbuild.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# See https://cloud.google.com/cloud-build/docs/build-config
22
timeout: 3600s
33
options:
4-
substitution_option: ALLOW_LOOSE
4+
substitutionOption: ALLOW_LOOSE
55
steps:
66
- name: gcr.io/cloud-builders/git
77
dir: "go/src/sigs.k8s.io"
@@ -19,7 +19,7 @@ steps:
1919
echo "Checking out ${_PULL_BASE_REF}"
2020
git checkout ${_PULL_BASE_REF}
2121
22-
- name: 'gcr.io/k8s-staging-releng/releng-ci:latest-go1.22-bookworm'
22+
- name: 'gcr.io/k8s-staging-releng/releng-ci:latest-go1.24-bookworm'
2323
dir: "go/src/sigs.k8s.io/bom"
2424
entrypoint: go
2525
env:

cmd/bom/cmd/generate.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"github.com/sirupsen/logrus"
2626
"github.com/spf13/cobra"
2727

28-
"sigs.k8s.io/release-utils/util"
28+
"sigs.k8s.io/release-utils/helpers"
2929
"sigs.k8s.io/release-utils/version"
3030

3131
"sigs.k8s.io/bom/pkg/license"
@@ -84,7 +84,7 @@ func (opts *generateOptions) Validate() error {
8484
} {
8585
// Check if image archives exist
8686
for i, iPath := range col.Items {
87-
if !isGlob(iPath) && !util.Exists(iPath) {
87+
if !isGlob(iPath) && !helpers.Exists(iPath) {
8888
return fmt.Errorf("%s #%d not found (%s)", col.Name, i+1, iPath)
8989
}
9090
}
@@ -125,7 +125,7 @@ completed by a later stage in your CI/CD pipeline. See the
125125
PersistentPreRunE: initLogging,
126126
RunE: func(cmd *cobra.Command, args []string) error {
127127
for i, arg := range args {
128-
if !util.Exists(arg) {
128+
if !helpers.Exists(arg) {
129129
continue
130130
}
131131
file, err := os.Open(arg)

cmd/bom/cmd/validate.go

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ import (
2323
"path/filepath"
2424
"strings"
2525

26-
"github.com/olekukonko/tablewriter"
2726
"github.com/sirupsen/logrus"
2827
"github.com/spf13/cobra"
2928

30-
"sigs.k8s.io/release-utils/util"
29+
"sigs.k8s.io/release-utils/helpers"
3130

3231
"sigs.k8s.io/bom/pkg/spdx"
3332
)
@@ -55,7 +54,7 @@ for checking files.
5554

5655
RunE: func(_ *cobra.Command, args []string) error {
5756
for i, arg := range args {
58-
if util.Exists(arg) {
57+
if helpers.Exists(arg) {
5958
file, err := os.Open(arg)
6059
if err != nil {
6160
return fmt.Errorf("checking argument %d: %w", i, err)
@@ -192,13 +191,10 @@ func validateArtifacts(opts validateOptions) error {
192191
data = append(data, resRow)
193192
}
194193

195-
table := tablewriter.NewWriter(os.Stdout)
196-
table.SetHeader([]string{"FileName", "Valid", "Message", "Invalid Hashes"})
194+
table := helpers.NewTableWriterWithDefaultsAndHeader(os.Stdout, []string{"FileName", "Valid", "Message", "Invalid Hashes"})
197195

198-
for _, v := range data {
199-
table.Append(v)
200-
}
201-
table.Render()
196+
_ = table.Bulk(data) //nolint: errcheck
197+
_ = table.Render() //nolint: errcheck
202198

203199
if errored {
204200
return errors.New("failed to validate all files")

0 commit comments

Comments
 (0)