@@ -10,6 +10,7 @@ import { predicateFromInputs } from './predicate'
1010import { subjectFromInputs } from './subject'
1111
1212type SigstoreInstance = 'public-good' | 'github'
13+ type AttestedSubject = { subject : Subject ; attestationID : string }
1314
1415const COLOR_CYAN = '\x1B[36m'
1516const COLOR_DEFAULT = '\x1B[39m'
@@ -30,6 +31,7 @@ export async function run(): Promise<void> {
3031 : 'github'
3132
3233 try {
34+ const atts : AttestedSubject [ ] = [ ]
3335 if ( ! process . env . ACTIONS_ID_TOKEN_REQUEST_URL ) {
3436 throw new Error (
3537 'missing "id-token" permission. Please add "permissions: id-token: write" to your workflow.'
@@ -52,15 +54,23 @@ export async function run(): Promise<void> {
5254 } )
5355
5456 if ( att . attestationID ) {
57+ atts . push ( { subject, attestationID : att . attestationID } )
58+ }
59+ }
60+
61+ if ( atts . length > 0 ) {
62+ core . summary . addHeading (
63+ /* istanbul ignore next */
64+ atts . length > 1 ? 'Attestations Created' : 'Attestation Created' ,
65+ 3
66+ )
67+
68+ for ( const { subject, attestationID } of atts ) {
5569 core . summary . addLink (
5670 `${ subject . name } @${ subjectDigest ( subject ) } ` ,
57- attestationURL ( att . attestationID )
71+ attestationURL ( attestationID )
5872 )
5973 }
60- }
61-
62- if ( ! core . summary . isEmptyBuffer ( ) ) {
63- core . summary . addHeading ( 'Attestation(s) Created' , 3 )
6474 core . summary . write ( )
6575 }
6676
0 commit comments