55 branches : [ main ]
66 pull_request :
77 branches : [ main ]
8+
9+ permissions :
10+ id-token : write # This is required for requesting the JWT
11+ contents : read # This is required for actions/checkout
812
913jobs :
1014 test-basic :
@@ -85,4 +89,105 @@ jobs:
8589 uses : actions/upload-artifact@v4
8690 with :
8791 name : attestation-files
88- path : ./multi-attestation.json
92+ path : ./multi-attestation.json
93+
94+ test-sigstore-archivista :
95+ runs-on : ubuntu-latest
96+ steps :
97+ - name : Checkout repository
98+ uses : actions/checkout@v3
99+
100+ - name : Setup Node.js
101+ uses : actions/setup-node@v3
102+ with :
103+ node-version : ' 16'
104+
105+ - name : Install dependencies
106+ run : npm ci
107+
108+ - name : Test with Sigstore and Archivista
109+ id : sigstore-attestation
110+ uses : ./
111+ with :
112+ # Action to run
113+ action-ref : " actions/hello-world-javascript-action@main"
114+ input-who-to-greet : " Sigstore"
115+
116+ # Witness configuration
117+ step : test-sigstore
118+ attestations : " environment git github slsa"
119+ attestor-slsa-export : " true"
120+ enable-sigstore : " true"
121+ enable-archivista : " true"
122+ outfile : " ./sigstore-attestation.json"
123+
124+ - name : Check GitOID output
125+ run : |
126+ if [[ -n "${{ steps.sigstore-attestation.outputs.git_oid }}" ]]; then
127+ echo "GitOID: ${{ steps.sigstore-attestation.outputs.git_oid }}"
128+ echo "Attestation succeeded with Sigstore and Archivista"
129+ else
130+ echo "No GitOID returned - this might be expected in PR builds without proper credentials"
131+ fi
132+
133+ - name : Check attestation file
134+ run : |
135+ if [[ -f "./sigstore-attestation.json" ]]; then
136+ echo "Sigstore attestation created successfully"
137+ jq . "./sigstore-attestation.json" | head -n 20
138+ else
139+ echo "Sigstore attestation file not found!"
140+ exit 1
141+ fi
142+
143+ - name : Upload sigstore attestation as artifact
144+ uses : actions/upload-artifact@v4
145+ with :
146+ name : sigstore-attestation
147+ path : ./sigstore-attestation.json
148+
149+ test-direct-command :
150+ runs-on : ubuntu-latest
151+ steps :
152+ - name : Checkout repository
153+ uses : actions/checkout@v3
154+
155+ - name : Setup Node.js
156+ uses : actions/setup-node@v3
157+ with :
158+ node-version : ' 16'
159+
160+ - name : Install dependencies
161+ run : npm ci
162+
163+ - name : Test direct command
164+ id : direct-command
165+ uses : ./
166+ with :
167+ # Direct command to run
168+ command : " echo hello > hello.txt"
169+
170+ # Witness configuration
171+ step : " direct-command"
172+ attestations : " command environment"
173+ outfile : " ./direct-command.json"
174+
175+ - name : Check command output
176+ run : |
177+ if [ -f "hello.txt" ]; then
178+ echo "Command output:"
179+ cat hello.txt
180+ else
181+ echo "Command output file not found!"
182+ exit 1
183+ fi
184+
185+ - name : Check attestation file
186+ run : |
187+ if [[ -f "./direct-command.json" ]]; then
188+ echo "Direct command attestation created successfully"
189+ jq . "./direct-command.json" | head -n 20
190+ else
191+ echo "Direct command attestation file not found!"
192+ exit 1
193+ fi
0 commit comments