Skip to content

Commit 2f0a04d

Browse files
Revert "remove debug fiel"
This reverts commit 8cde63a. Signed-off-by: Ramon Petgrave <[email protected]> Signed-off-by: Ramon Petgrave <[email protected]>
1 parent 769ff49 commit 2f0a04d

File tree

1 file changed

+146
-0
lines changed

1 file changed

+146
-0
lines changed
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
# Copyright 2023 SLSA Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# a test workflow for debugging the generic generator
16+
17+
name: debug-generic-generator
18+
19+
on:
20+
push:
21+
22+
permissions: read-all
23+
24+
env:
25+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
27+
jobs:
28+
generic-build:
29+
outputs:
30+
hashes: ${{ steps.hash.outputs.hashes }}
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Build artifacts
34+
run: |
35+
# These are some amazing artifacts.
36+
echo "foo" > artifact1
37+
echo "bar" > artifact2
38+
39+
- name: Generate hashes
40+
shell: bash
41+
id: hash
42+
run: |
43+
# sha256sum generates sha256 hash for all artifacts.
44+
# base64 -w0 encodes to base64 and outputs on a single line.
45+
# sha256sum artifact1 artifact2 ... | base64 -w0
46+
echo "hashes=$(sha256sum artifact1 artifact2 | base64 -w0)" >> "$GITHUB_OUTPUT"
47+
48+
- name: Upload artifact1
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: artifact1
52+
path: artifact1
53+
if-no-files-found: error
54+
retention-days: 5
55+
56+
- name: Upload artifact2
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: artifact2
60+
path: artifact2
61+
if-no-files-found: error
62+
retention-days: 5
63+
64+
generic-provenance:
65+
needs: generic-build
66+
permissions:
67+
id-token: write # For signing.
68+
contents: write # For asset uploads.
69+
actions: read # For reading workflow info.
70+
uses: ./.github/workflows/generator_generic_slsa3.yml
71+
with:
72+
base64-subjects: "${{ needs.generic-build.outputs.hashes }}"
73+
compile-generator: true
74+
provenance-name: generic-build.intoto.jsonl
75+
upload-assets: true
76+
77+
generic-verify:
78+
needs: generic-provenance
79+
runs-on: ubuntu-latest
80+
steps:
81+
- name: Download artifact1
82+
uses: actions/download-artifact@v4
83+
with:
84+
name: artifact1
85+
- name: Download artifact2
86+
uses: actions/download-artifact@v4
87+
with:
88+
name: artifact2
89+
- name: Download provenance
90+
uses: actions/download-artifact@v4
91+
with:
92+
name: "${{ needs.generic-provenance.outputs.provenance-name }}"
93+
- uses: actions/setup-go@v5
94+
with:
95+
go-version: 1.22
96+
- name: Setup slsa-verifier
97+
run: go install github.com/slsa-framework/slsa-verifier/v2/cli/slsa-verifier@verify-sigstore-go-Bundlev3
98+
- name: Verify
99+
run: |
100+
SLSA_VERIFIER_TESTING=1 slsa-verifier verify-artifact \
101+
artifact1 artifact2 \
102+
--provenance-path generic-build.intoto.jsonl \
103+
--source-uri github.com/slsa-framework/slsa-github-generator \
104+
--source-branch ramonpetgrave64-internal-builder-sigstore-bundlev2 \
105+
--print-provenance
106+
107+
go-build:
108+
permissions:
109+
id-token: write # To sign the provenance.
110+
contents: write # To upload assets to release.
111+
actions: read # To read the workflow path.
112+
uses: ./.github/workflows/builder_go_slsa3.yml
113+
with:
114+
go-version: 1.22
115+
config-file: .github/workflows/configs-container/config-release.yml
116+
compile-builder: true
117+
118+
go-verify:
119+
needs: [generic-provenance, go-build]
120+
runs-on: ubuntu-latest
121+
steps:
122+
- name: Download artifact
123+
uses: actions/download-artifact@v4
124+
with:
125+
name: "${{ needs.go-build.outputs.go-binary-name }}"
126+
- name: Download provenance
127+
uses: actions/download-artifact@v4
128+
with:
129+
name: "${{ needs.go-build.outputs.go-provenance-name }}"
130+
- uses: actions/setup-go@v5
131+
with:
132+
go-version: 1.22
133+
- name: Setup slsa-verifier
134+
run: go install github.com/slsa-framework/slsa-verifier/v2/cli/slsa-verifier@verify-sigstore-go-Bundlev3
135+
- name: Verify
136+
env:
137+
ARTIFACT: "${{ needs.go-build.outputs.go-binary-name }}"
138+
PROVENANCE: "${{ needs.go-build.outputs.go-provenance-name }}"
139+
run: |
140+
ls -lah
141+
SLSA_VERIFIER_TESTING=1 slsa-verifier verify-artifact \
142+
"$ARTIFACT" \
143+
--provenance-path "$PROVENANCE" \
144+
--source-uri github.com/slsa-framework/slsa-github-generator \
145+
--source-branch ramonpetgrave64-internal-builder-sigstore-bundlev2 \
146+
--print-provenance

0 commit comments

Comments
 (0)