File tree Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Original file line number Diff line number Diff line change 38
38
run : |
39
39
[[ -f ./test/artifact.txt.sigstore ]] || exit 1
40
40
41
+ selftest-release-signing-artifacts-no-op :
42
+ strategy :
43
+ matrix :
44
+ os :
45
+ - ubuntu-latest
46
+ - macos-latest
47
+ - windows-latest
48
+ runs-on : ${{ matrix.os }}
49
+ if : (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
50
+ steps :
51
+ - uses : actions/checkout@v4
52
+ - uses : actions/setup-python@v5
53
+ if : ${{ matrix.os != 'ubuntu-latest' }}
54
+ with :
55
+ python-version : " 3.x"
56
+ - name : Sign artifact and publish signature
57
+ uses : ./
58
+ id : sigstore-python
59
+ with :
60
+ inputs : ./test/artifact.txt
61
+ # The trigger for this test is not a release, so this has no effect
62
+ # (but does not break the workflow either).
63
+ release-signing-artifacts : true
64
+ internal-be-careful-debug : true
65
+ - name : Check outputs
66
+ shell : bash
67
+ run : |
68
+ [[ -f ./test/artifact.txt.sigstore ]] || exit 1
69
+
41
70
selftest-xfail-invalid-inputs :
42
71
runs-on : ubuntu-latest
43
72
strategy :
@@ -285,6 +314,7 @@ jobs:
285
314
286
315
needs :
287
316
- selftest
317
+ - selftest-release-signing-artifacts-no-op
288
318
- selftest-xfail-invalid-inputs
289
319
- selftest-staging
290
320
- selftest-glob
Original file line number Diff line number Diff line change @@ -370,6 +370,7 @@ Example:
370
370
371
371
The `release-signing-artifacts` setting controls whether or not `sigstore-python`
372
372
uploads signing artifacts to the release publishing event that triggered this run.
373
+ This setting has no effect on non-`release` events.
373
374
374
375
If enabled, this setting also re-uploads and signs GitHub's default source code artifacts,
375
376
as they are not guaranteed to be stable.
Original file line number Diff line number Diff line change 38
38
_RENDER_SUMMARY = os .getenv ("GHA_SIGSTORE_PYTHON_SUMMARY" , "true" ) == "true"
39
39
_DEBUG = os .getenv ("GHA_SIGSTORE_PYTHON_INTERNAL_BE_CAREFUL_DEBUG" , "false" ) != "false"
40
40
41
+ _RELEASE_SIGNING_ARTIFACTS = (
42
+ os .getenv ("GHA_SIGSTORE_PYTHON_RELEASE_SIGNING_ARTIFACTS" , "true" ) == "true"
43
+ and os .getenv ("GITHUB_EVENT_NAME" ) == "release"
44
+ )
45
+
41
46
42
47
def _template (name ):
43
48
path = _TEMPLATES / f"{ name } .md"
@@ -189,7 +194,7 @@ def _fatal_help(msg):
189
194
elif verify_oidc_issuer :
190
195
sigstore_verify_args .extend (["--cert-oidc-issuer" , verify_oidc_issuer ])
191
196
192
- if os . getenv ( "GHA_SIGSTORE_PYTHON_RELEASE_SIGNING_ARTIFACTS" ) == "true" :
197
+ if _RELEASE_SIGNING_ARTIFACTS :
193
198
for filetype in ["zip" , "tar.gz" ]:
194
199
artifact = _download_ref_asset (filetype )
195
200
if artifact is not None :
You can’t perform that action at this time.
0 commit comments