File tree Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change
1
+ from pathlib import Path
2
+ from pypi_attestations import Attestation
3
+ from sigstore .models import Bundle
4
+
5
+ # Sigstore Bundle -> PEP 740 Attestation object
6
+ filename = 'test_package-0.0.1-py3-none-any.whl'
7
+ bundle_path = Path (f'{ filename } .sigstore' )
8
+ sigstore_bundle = Bundle .from_json (bundle_path .read_bytes ())
9
+ attestation = Attestation .from_bundle (sigstore_bundle )
10
+ print (attestation .model_dump_json ())
11
+ signature_path = Path (f"{ filename } .publish.attestation" )
12
+ signature_path .write_text (attestation .model_dump_json ())
13
+ print (f"Attestation for { filename } written to { signature_path } " )
Original file line number Diff line number Diff line change @@ -70,11 +70,15 @@ jobs:
70
70
core.setOutput('api-token', api_token)
71
71
72
72
- uses : actions/attest@v1
73
+ id : attest
73
74
with :
74
- subject-path : ' dist/*'
75
- predicate-type : ' https://docs.pypi.org/attestations/publish/v1'
76
- predicate : ' {}'
77
- show-summary : true
75
+ subject-path : " dist/*"
76
+ predicate-type : " https://docs.pypi.org/attestations/publish/v1"
77
+ predicate : " null"
78
+ show-summary : " true"
79
+
80
+ - run : cat "${{ steps.attest.outputs.bundle-path }}"
81
+ - run : jq < "${{ steps.attest.outputs.bundle-path }}"
78
82
79
83
# - name: Generate PEP 740 attestations
80
84
# run: |
You can’t perform that action at this time.
0 commit comments