Skip to content

Commit ea05345

Browse files
test workflows
Signed-off-by: Ramon Petgrave <[email protected]> Signed-off-by: Ramon Petgrave <[email protected]>
1 parent 7f2186f commit ea05345

File tree

3 files changed

+54
-22
lines changed

3 files changed

+54
-22
lines changed

.github/workflows/builder_go_slsa3.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -319,20 +319,18 @@ jobs:
319319
go-provenance-name: ${{ steps.sign-prov.outputs.signed-provenance-name }}
320320
go-provenance-sha256: ${{ steps.sign-prov.outputs.signed-provenance-sha256 }}
321321
steps:
322-
- name: Checkout builder repository
323-
uses: slsa-framework/slsa-github-generator/.github/actions/secure-builder-checkout@main
322+
- name: Generate builder
323+
id: generate-builder
324+
continue-on-error: true
325+
uses: slsa-framework/slsa-github-generator/.github/actions/generate-builder@main
324326
with:
325327
repository: "${{ needs.detect-env.outputs.repository }}"
326328
ref: "${{ needs.detect-env.outputs.ref }}"
327-
path: __BUILDER_CHECKOUT_DIR__
328-
329-
- name: Download builder
330-
uses: ./__BUILDER_CHECKOUT_DIR__/.github/actions/secure-download-artifact
331-
with:
332-
name: "${{ env.BUILDER_BINARY }}-${{ needs.rng.outputs.value }}"
333-
path: "${{ env.BUILDER_BINARY }}"
334-
sha256: "${{ needs.builder.outputs.go-builder-sha256 }}"
335-
set-executable: true
329+
go-version: "1.22"
330+
binary: "${{ env.BUILDER_BINARY }}"
331+
compile-builder: "true"
332+
directory: "${{ env.BUILDER_DIR }}"
333+
allow-private-repository: ${{ inputs.private-repository }}
336334

337335
- name: Create and sign provenance
338336
id: sign-prov

.github/workflows/debug.generic-generator.yml

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ env:
2525
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2626

2727
jobs:
28-
build:
28+
generic-build:
2929
outputs:
3030
hashes: ${{ steps.hash.outputs.hashes }}
3131
runs-on: ubuntu-latest
@@ -61,21 +61,21 @@ jobs:
6161
if-no-files-found: error
6262
retention-days: 5
6363

64-
provenance:
65-
needs: build
64+
generic-provenance:
65+
needs: generic-build
6666
permissions:
6767
id-token: write # For signing.
6868
contents: write # For asset uploads.
6969
actions: read # For reading workflow info.
7070
uses: ./.github/workflows/generator_generic_slsa3.yml
7171
with:
72-
base64-subjects: "${{ needs.build.outputs.hashes }}"
72+
base64-subjects: "${{ needs.generic-build.outputs.hashes }}"
7373
compile-generator: true
74-
provenance-name: build.intoto.jsonl
74+
provenance-name: generic-build.intoto.jsonl
7575
upload-assets: true
7676

77-
verify:
78-
needs: provenance
77+
generic-verify:
78+
needs: generic-provenance
7979
runs-on: ubuntu-latest
8080
steps:
8181
- name: Download artifact1
@@ -89,7 +89,7 @@ jobs:
8989
- name: Download provenance
9090
uses: actions/download-artifact@v4
9191
with:
92-
name: build.intoto.jsonl
92+
name: "${{ needs.generic-provenance.outputs.provenance-name }}"
9393
- uses: actions/setup-go@v5
9494
with:
9595
go-version: 1.22
@@ -99,7 +99,41 @@ jobs:
9999
run: |
100100
SLSA_VERIFIER_TESTING=1 slsa-verifier verify-artifact \
101101
artifact1 artifact2 \
102-
--provenance-path build.intoto.jsonl \
102+
--provenance-path generic-build.intoto.jsonl \
103103
--source-uri github.com/slsa-framework/slsa-github-generator \
104104
--source-branch ramonpetgrave64-internal-builder-sigstore-bundle \
105105
--print-provenance
106+
107+
go-build:
108+
uses: ./.github/workflows/builder_go_slsa3.yml
109+
with:
110+
go-version: 1.22
111+
112+
go-verify:
113+
needs: generic-provenance
114+
runs-on: ubuntu-latest
115+
steps:
116+
- name: Download artifact
117+
uses: actions/download-artifact@v4
118+
with:
119+
name: "${{ needs.go-build.outputs.go-binary-name }}"
120+
- name: Download provenance
121+
uses: actions/download-artifact@v4
122+
with:
123+
name: "${{ needs.go-build.outputs.go-provenance-name }}"
124+
- uses: actions/setup-go@v5
125+
with:
126+
go-version: 1.22
127+
- name: Setup slsa-verifier
128+
run: go install github.com/slsa-framework/slsa-verifier/v2/cli/slsa-verifier@verify-sigstore-go-Bundlev2
129+
- name: Verify
130+
env:
131+
ARTIFACT: "${{ needs.go-build.outputs.go-provenance-name }}"
132+
PROVENANCE: "${{ needs.go-build.outputs.go-provenance-name }}"
133+
run: |
134+
SLSA_VERIFIER_TESTING=1 slsa-verifier verify-artifact \
135+
"$ARTIFACT" \
136+
--provenance-path "$PROVENANCE" \
137+
--source-uri github.com/slsa-framework/slsa-github-generator \
138+
--source-branch ramonpetgrave64-internal-builder-sigstore-bundle \
139+
--print-provenance

.github/workflows/generator_generic_slsa3.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ on:
9696
value: ${{ jobs.upload-assets.outputs.release-id }}
9797
provenance-name:
9898
description: "The artifact name of the signed provenance. (A file with the intoto.jsonl extension)."
99-
value: ${{ jobs.generator.outputs.provenance-name }}
99+
value: provenance-name
100100
# Note: we use this output because there is no buildt-in `outcome` and `result` is always `success`
101101
# if `continue-on-error` is set to `true`.
102102
outcome:
@@ -160,7 +160,7 @@ jobs:
160160
with:
161161
repository: "${{ needs.detect-env.outputs.repository }}"
162162
ref: "${{ needs.detect-env.outputs.ref }}"
163-
go-version: "1.21"
163+
go-version: "1.22"
164164
binary: "${{ env.BUILDER_BINARY }}"
165165
compile-builder: "${{ inputs.compile-generator }}"
166166
directory: "${{ env.BUILDER_DIR }}"

0 commit comments

Comments
 (0)