File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -62,13 +62,17 @@ jobs:
62
62
run : |
63
63
python -m pypi_attestations inspect dist/*.publish.attestation
64
64
65
- - name : Upload attestations bundles
65
+ - name : Prepare attestation bundles for uploading
66
+ run : |
67
+ mkdir -p /tmp/attestation-bundles
68
+ cp "${{ steps.attest.outputs.bundle-path }}" /tmp/attestation-bundles/
69
+ cp dist/*.publish.attestation /tmp/attestation-bundles/
70
+
71
+ - name : Upload attestation bundles
66
72
uses : actions/upload-artifact@v4
67
73
with :
68
- name : attestations
69
- path : |
70
- ${{ steps.attest.outputs.bundle-path }}
71
- dist/*.publish.attestation
74
+ name : attestation-bundles
75
+ path : /tmp/attestation-bundles/
72
76
73
77
- name : Mint PyPI API token
74
78
id : mint-token
Original file line number Diff line number Diff line change 3
3
See https://github.com/trailofbits/pypi-attestations.
4
4
"""
5
5
6
- import base64
7
6
import json
8
7
import sys
8
+ from base64 import b64decode
9
9
from pathlib import Path
10
10
11
11
from pypi_attestations import Attestation , Distribution
19
19
20
20
for line in bundle_path .read_bytes ().splitlines ():
21
21
dsse_envelope_payload = json .loads (line )['dsseEnvelope' ]['payload' ]
22
- subjects = json .loads (base64 . b64decode (dsse_envelope_payload ))['subject' ]
22
+ subjects = json .loads (b64decode (dsse_envelope_payload ))['subject' ]
23
23
for subject in subjects :
24
24
filename = subject ['name' ]
25
25
assert (DIST / filename ).is_file ()
28
28
print (f'Converting attestation for { filename } ' )
29
29
sigstore_bundle = Bundle .from_json (line )
30
30
attestation = Attestation .from_bundle (sigstore_bundle )
31
- print (attestation .model_dump_json ())
32
31
attestation_path = DIST / f'{ filename } .publish.attestation'
33
32
attestation_path .write_text (attestation .model_dump_json ())
34
33
print (f'Attestation for { filename } written to { attestation_path } ' )
You can’t perform that action at this time.
0 commit comments