Skip to content

Commit c274b55

Browse files
committed
dump
1 parent 0319346 commit c274b55

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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}")

.github/workflows/create-release.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,15 @@ jobs:
7070
core.setOutput('api-token', api_token)
7171

7272
- uses: actions/attest@v1
73+
id: attest
7374
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 }}"
7882

7983
# - name: Generate PEP 740 attestations
8084
# run: |

0 commit comments

Comments
 (0)