Skip to content

Commit b8b477c

Browse files
Attach signing artifacts to GitHub releases if running in a release workflow (#14)
* Expose the signature and certificate outputs as workflow artifacts * Put each path on a newline * Cleanup * Support `--certificate` and `--signature` flags * Don't write artifact paths if `--no-default-files` has been provided * Attach signing artifacts to GitHub releases if running in a release workflow * Fix GH Action name * Change the trigger from tag pushes to release creation * action: setting for release artifacts Signed-off-by: William Woodruff <[email protected]> * README: document `release-signing-artifacts` setting Signed-off-by: William Woodruff <[email protected]> Co-authored-by: William Woodruff <[email protected]>
1 parent 396ae72 commit b8b477c

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,31 @@ Example:
298298
upload-signing-artifacts: true
299299
```
300300

301+
### `release-signing-artifacts`
302+
303+
**Default**: `false`
304+
305+
The `release-signing-artifacts` setting controls whether or not `sigstore-python`
306+
uploads signing artifacts to the release that triggered this run.
307+
308+
By default, no release assets are uploaded.
309+
310+
Requires the [`contents: write` permission](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token).
311+
312+
Example:
313+
314+
```yaml
315+
permissions:
316+
contents: write
317+
318+
# ...
319+
320+
- uses: trailofbits/[email protected]
321+
with:
322+
inputs: file.txt
323+
release-signing-artifacts: true
324+
```
325+
301326
### Internal options
302327
<details>
303328
<summary>⚠️ Internal options ⚠️</summary>

action.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ inputs:
5858
description: "upload all signing artifacts as workflow artifacts"
5959
required: false
6060
default: false
61+
release-signing-artifacts:
62+
description: "attach all signing artifacts as release assets"
63+
required: false
64+
default: false
6165
internal-be-careful-debug:
6266
description: "run with debug logs (default false)"
6367
required: false
@@ -93,7 +97,12 @@ runs:
9397
shell: bash
9498

9599
- uses: actions/upload-artifact@v3
96-
if: ${{ inputs.upload-signing-artifacts == 'true' }}
100+
if: inputs.upload-signing-artifacts == 'true'
97101
with:
98102
name: "signing-artifacts-${{ github.job }}"
99103
path: "${{ env.GHA_SIGSTORE_PYTHON_SIGNING_ARTIFACTS }}"
104+
105+
- uses: softprops/action-gh-release@v1
106+
if: inputs.release-signing-artifacts == 'true' && github.event_name == 'release' && github.event.action == 'created'
107+
with:
108+
files: "${{ env.GHA_SIGSTORE_PYTHON_SIGNING_ARTIFACTS }}"

0 commit comments

Comments
 (0)