Release Draft¶
Create or update a draft GitHub release from a release-drafter style config, a resolved version, and changelog content.
Usage¶
- name: Create draft release
id: release_draft
uses: athackst/ci/actions/release-draft@main
with:
token: ${{ github.token }}
resolved-version: ${{ steps.version.outputs.resolved-version }}
changelog: ${{ steps.changelog.outputs.changelog }}
Inputs¶
| Name | Description | Default |
|---|---|---|
token |
GitHub token used to draft the release. | None |
configuration-path |
(optional) Path to a release-drafter style config file. | Bundled release-drafter.yml |
changelog |
Changelog content interpolated into the release body template. | None |
resolved-version |
Version interpolated into the release name and tag templates. | None |
release-match-pattern |
(optional) Regex used to find an existing draft release to update by tag name. | ^v[0-9]+(\.[0-9]+)*$ |
name |
(optional) Release name override. | Rendered from config |
tag-name |
(optional) Release tag name override. | Rendered from config |
Outputs¶
| Name | Description |
|---|---|
id |
The release ID. |
name |
The release name. |
tag-name |
The release tag name. |
html-url |
The HTML URL for the release. |
upload-url |
The upload URL for release assets. |
Permissions¶
- Requires a token that can create and update releases.
contents: writeis typically sufficient.
Advanced¶
- Uses the bundled
release-drafter.ymlwhenconfiguration-pathis not set. - Supports
name-template,tag-template, andtemplate, plustemplate-filefor loading the release body from a file. - Template interpolation supports
$RESOLVED_VERSION,$VERSION,$CHANGES, and$CHANGELOG. - If exactly one draft release matches
release-match-pattern, that draft is updated in place. - If multiple draft releases match
release-match-pattern, the action fails rather than guessing. - If a non-draft release already exists for the resolved tag, the action fails instead of replacing it.
Examples¶
Use a repository-specific release config: