Skip to main content

GitHub Action: auto-release

This is an opinionated composite Github Action that implements a workflow based on the popular release-drafter action to automatically draft releases with release notes that are derived from PR descriptions as they are merged into the default branch. ```

Under default settings, auto-release will also cut a new release from the default branch after every merge into it. However, releases are not cut for merges of pull requests with a no-release label attached. In that case, the release notes are left as a draft and a release with all unreleased changes will be made the next time a pull request without the no-release label is merged into the default branch.

Usage

Copy the .github/workflows/auto-release.yml and .github/configs/release-drafter.yml files from this repository into the corresponding folders of the repository to which you'd like to add Auto-release functionality. This will trigger the auto-release functionality every time merges are made into the default branch.

Quick Start

Here's how to get started...

  1. Copy the .github/workflows/auto-release.yml github action workflow from this repository into the corresponding folder of the target repo
  2. Copy the .github/configs/release-drafter.yml auto-release config file from this repository into the corresponding folder of the target repo
  3. Customize the config file as desired, per the config documentation

Examples

Here's a real world example:

Inputs

NameDescriptionDefaultRequired
config-nameIf your workflow requires multiple release-drafter configs it is helpful to override the config-name.
The config should still be located inside .github as that's where we are looking for config files.
configs/draft-release.ymlfalse
latestA string indicating whether the release being created or updated should be marked as latest.
false
prereleaseBoolean indicating whether this release should be a prereleasefalse
publishWhether to publish a new release immediatelyfalsefalse
summary-enabledEnable github action summary.truefalse
tokenStandard GitHub token (e.g., secrets.GITHUB_TOKEN)${{ github.token }}false

Outputs

NameDescription
bodyThe body of the drafted release.
existsTag exists so skip new release issue
html_urlThe URL users can navigate to in order to view the release
idThe ID of therelease that was created or updated.
major_versionThe next major version number. For example, if the last tag or release was v1.2.3, the value would be v2.0.0.
minor_versionThe next minor version number. For example, if the last tag or release was v1.2.3, the value would be v1.3.0.
nameThe name of the release
patch_versionThe next patch version number. For example, if the last tag or release was v1.2.3, the value would be v1.2.4.
resolved_versionThe next resolved version number, based on GitHub labels.
tag_nameThe name of the tag associated with the release.
upload_urlThe URL for uploading assets to the release, which could be used by GitHub Actions for additional uses, for example the @actions/upload-release-asset GitHub Action.