Skip to content

Commit 939ceb1

Browse files
committed
copypaste workflow for debugging
1 parent ff0ba51 commit 939ceb1

File tree

2 files changed

+20
-31
lines changed

2 files changed

+20
-31
lines changed

.github/workflows/integrate.yaml

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,21 @@ jobs:
1414
contents: 'write' # Needs write access for upload-artifact.
1515
outputs:
1616
checksums-handle: '${{ steps.checksum-handle.outputs.handle }}'
17-
sbom-handle: '${{ steps.sbom-handle.outputs.handle }}'
18-
version: '${{ steps.version.outputs.version }}'
1917
env:
20-
SBOM_FILE_NAME: 'cyclonedx_bom.json'
18+
CHECKSUMS_FILE_NAME: 'checksums.txt'
2119
steps:
2220
- name: 'checkout'
2321
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # ratchet:actions/checkout@v5
2422
with:
2523
fetch-depth: 0 # So that goreleaser can determine the base version.
24+
- name: setup go
25+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # ratchet:actions/setup-go@v6
26+
with:
27+
go-version: "1.25.x"
28+
- name: 'setup cyclonedx-gomod'
29+
uses: 'CycloneDX/gh-gomod-generate-sbom@efc74245d6802c8cefd925620515442756c70d8f' # ratchet:CycloneDX/gh-gomod-generate-sbom@v2
30+
with:
31+
version: 'v1'
2632
- name: 'build'
2733
id: 'goreleaser'
2834
uses: 'goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a' # ratchet:goreleaser/goreleaser-action@v6
@@ -45,26 +51,14 @@ jobs:
4551
name: 'conftest_${{ steps.version.outputs.version }}'
4652
path: 'dist/*.*'
4753
retention-days: 30
48-
- name: 'generate sbom'
49-
uses: 'CycloneDX/gh-gomod-generate-sbom@efc74245d6802c8cefd925620515442756c70d8f' # ratchet:CycloneDX/gh-gomod-generate-sbom@v2
50-
with:
51-
version: 'v1'
52-
args: >-
53-
mod
54-
-licenses
55-
-json
56-
-verbose
57-
-output ${{ env.SBOM_FILE_NAME }}
54+
- name: 'base64 checksum for provenance input'
55+
shell: 'bash'
56+
run: 'base64 -w0 "dist/${CHECKSUMS_FILE_NAME}" > "${CHECKSUMS_FILE_NAME}"'
5857
- name: 'get checksums handle'
5958
id: 'checksum-handle'
6059
uses: 'slsa-framework/slsa-github-generator/actions/generator/generic/[email protected]' # ratchet:exclude
6160
with:
62-
path: 'dist/checksums.txt'
63-
- name: 'get sbom handle'
64-
id: 'sbom-handle'
65-
uses: 'slsa-framework/slsa-github-generator/actions/generator/generic/[email protected]' # ratchet:exclude
66-
with:
67-
path: '${{ env.SBOM_FILE_NAME }}'
61+
path: '${{ env.CHECKSUMS_FILE_NAME }}'
6862

6963
binary-provenance:
7064
needs: ['goreleaser']
@@ -77,17 +71,6 @@ jobs:
7771
base64-subjects-as-file: '${{ needs.goreleaser.outputs.checksums-handle }}'
7872
upload-assets: false
7973

80-
sbom-provenance:
81-
needs: ['goreleaser']
82-
permissions:
83-
contents: 'write' # Needs write access for upload-artifact even when upload-assets is false.
84-
actions: 'read' # To read the workflow path.
85-
id-token: 'write' # To sign the provenance.
86-
uses: 'slsa-framework/slsa-github-generator/.github/workflows/[email protected]' # ratchet:exclude
87-
with:
88-
base64-subjects-as-file: '${{ needs.goreleaser.outputs.sbom-handle }}'
89-
upload-assets: false
90-
9174
# docker:
9275
# runs-on: 'ubuntu-latest'
9376
# permissions:

.goreleaser.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ version: 1
22

33
before:
44
hooks:
5-
- go mod download
5+
- 'go mod download'
6+
- >-
7+
cyclonedx-gomod mod
8+
-licenses
9+
-json
10+
-output cyclonedx_bom.json
611
712
builds:
813
- main: ./main.go
@@ -40,6 +45,7 @@ archives:
4045
files:
4146
- LICENSE
4247
- README.md
48+
- cyclonedx_bom.json
4349
- plugin/*.sh
4450

4551
checksum:

0 commit comments

Comments
 (0)