Drafts your next release notes as pull requests are merged into master. https://github.com/marketplace/actions/release-drafter
  • JavaScript 99.2%
  • Dockerfile 0.8%
Find a file
2026-03-06 18:28:34 +01:00
.devcontainer build: support OIDC for npmjs publishing (#1480) 2026-01-21 13:47:10 +01:00
.github ci: add actions/stale workflow for issues 2026-03-06 18:28:34 +01:00
.husky build: support OIDC for npmjs publishing (#1480) 2026-01-21 13:47:10 +01:00
.vscode use ESM and update most dependencies (#1003) 2022-01-12 22:16:35 +01:00
bin Add config option for history-limit (#1470) 2026-01-22 10:14:43 +01:00
design Added a gray stroke around the letters of the logo (#940) 2021-12-13 23:41:23 +01:00
dist feat: deprecate include-pre-releases in favor of prerelease (#1515) 2026-03-05 19:14:46 +01:00
docker fix typo: therelease (#1407) 2025-01-19 11:32:30 +01:00
docs Move GitHub App usage doc out of README to separate doc 2019-12-23 17:18:05 +01:00
lib feat: deprecate include-pre-releases in favor of prerelease (#1515) 2026-03-05 19:14:46 +01:00
test feat: deprecate include-pre-releases in favor of prerelease (#1515) 2026-03-05 19:14:46 +01:00
.dockerignore improve GitHub Action build times (#742) 2020-12-27 10:34:31 +01:00
.env.example First commit 2018-06-28 23:29:25 +10:00
.eslintignore improve GitHub Action build times (#742) 2020-12-27 10:34:31 +01:00
.eslintrc Bump eslint-plugin-unicorn from 42.0.0 to 43.0.2 (#1192) 2022-07-31 12:55:30 +00:00
.gitattributes add gitattributes 2020-04-06 16:23:35 +02:00
.gitignore build: support OIDC for npmjs publishing (#1480) 2026-01-21 13:47:10 +01:00
.npmrc build: support OIDC for npmjs publishing (#1480) 2026-01-21 13:47:10 +01:00
.prettierignore improve GitHub Action build times (#742) 2020-12-27 10:34:31 +01:00
.prettierrc Category templating (#767) 2021-01-28 08:39:32 +01:00
action.js fix server (#1010) 2022-01-13 04:01:29 +01:00
action.yml feat: 'commits-since' configuration option (#1451) 2026-01-21 20:03:58 +01:00
app.yml run prettier / eslint fix 2020-05-28 23:22:46 +02:00
CODE_OF_CONDUCT.md Apply prettier cleanups 2018-12-21 09:59:02 +11:00
CONTRIBUTING.md ci: add actions/stale workflow for issues 2026-03-06 18:28:34 +01:00
docker-compose.yml build: support OIDC for npmjs publishing (#1480) 2026-01-21 13:47:10 +01:00
Dockerfile build: support OIDC for npmjs publishing (#1480) 2026-01-21 13:47:10 +01:00
index.js feat: deprecate include-pre-releases in favor of prerelease (#1515) 2026-03-05 19:14:46 +01:00
LICENSE First commit 2018-06-28 23:29:25 +10:00
lint-staged.config.js move lint staged config to javascript file (#1027) 2022-01-19 01:36:52 +01:00
package-lock.json chore: release 6.3.0 2026-03-06 09:47:38 +01:00
package.json chore: release 6.3.0 2026-03-06 09:47:38 +01:00
README.md chore: update release procedure 2026-03-06 09:47:03 +01:00
schema.json update schema generation and update schema to draft 07 (#1422) 2025-01-19 13:01:14 +01:00

Release Drafter Logo

Drafts your next release notes as pull requests are merged into master. Built with Probot.


Usage

You can use the Release Drafter GitHub Action in a GitHub Actions Workflow by configuring a YAML-based workflow file, e.g. .github/workflows/release-drafter.yml, with the following:

name: Release Drafter

on:
  push:
    # branches to consider in the event; optional, defaults to all
    branches:
      - main
      - master

  # pull_request event is required only for autolabeler
  pull_request:
    # Only following types are handled by the action, but one can default to all as well
    types: [opened, reopened, synchronize]
  # pull_request_target event is required for autolabeler to support PRs from forks
  # pull_request_target:
  #   types: [opened, reopened, synchronize]

permissions:
  contents: read

jobs:
  update_release_draft:
    permissions:
      # write permission is required to create a github release
      contents: write
      # write permission is required for autolabeler
      # otherwise, read permission is required at least
      pull-requests: write
    runs-on: ubuntu-latest
    steps:
      # (Optional) GitHub Enterprise requires GHE_HOST variable set
      #- name: Set GHE_HOST
      #  run: |
      #    echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV

      # Drafts your next Release notes as Pull Requests are merged into "master"
      - uses: release-drafter/release-drafter@v6
        # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
        # with:
        #   config-name: my-config.yml
        #   disable-autolabeler: true
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

If you're unable to use GitHub Actions, you can use the Release Drafter GitHub App. Please refer to the Release Drafter GitHub App documentation for more information.

Configuration

Once youve added Release Drafter to your repository, it must be enabled by adding a .github/release-drafter.yml configuration file to each repository. The configuration file must reside in your default branch, no other configurations will be accepted.

Example

For example, take the following .github/release-drafter.yml file in a repository:

template: |
  ## Whats Changed

  $CHANGES

As pull requests are merged, a draft release is kept up-to-date listing the changes, ready to publish when youre ready:

Screenshot of generated draft release

The following is a more complicated configuration, which categorises the changes into headings, and automatically suggests the next version number:

name-template: 'v$RESOLVED_VERSION 🌈'
tag-template: 'v$RESOLVED_VERSION'
categories:
  - title: '🚀 Features'
    labels:
      - 'feature'
      - 'enhancement'
  - title: '🐛 Bug Fixes'
    labels:
      - 'fix'
      - 'bugfix'
      - 'bug'
  - title: '🧰 Maintenance'
    label: 'chore'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
  major:
    labels:
      - 'major'
  minor:
    labels:
      - 'minor'
  patch:
    labels:
      - 'patch'
  default: patch
template: |
  ## Changes

  $CHANGES

Configuration Options

You can configure Release Drafter using the following key in your .github/release-drafter.yml file:

Key Required Description
template Required The template for the body of the draft release. Use template variables to insert values.
header Optional Will be prepended to template. Use template variables to insert values.
footer Optional Will be appended to template. Use template variables to insert values.
category-template Optional The template to use for each category. Use category template variables to insert values. Default: "## $TITLE".
name-template Optional The template for the name of the draft release. For example: "v$NEXT_PATCH_VERSION".
tag-template Optional The template for the tag of the draft release. For example: "v$NEXT_PATCH_VERSION".
tag-prefix Optional A known prefix used to filter release tags. For matching tags, this prefix is stripped before attempting to parse the version. Default: ""
version-template Optional The template to use when calculating the next version number for the release. Useful for projects that don't use semantic versioning. Default: "$MAJOR.$MINOR.$PATCH"
change-template Optional The template to use for each merged pull request. Use change template variables to insert values. Default: "* $TITLE (#$NUMBER) @$AUTHOR".
change-title-escapes Optional Characters to escape in $TITLE when inserting into change-template so that they are not interpreted as Markdown format characters. Default: ""
no-changes-template Optional The template to use for when theres no changes. Default: "* No changes".
references Optional The references to listen for configuration updates to .github/release-drafter.yml. Refer to References to learn more about this
categories Optional Categorize pull requests using labels. Refer to Categorize Pull Requests to learn more about this option.
exclude-labels Optional Exclude pull requests using labels. Refer to Exclude Pull Requests to learn more about this option.
include-labels Optional Include only the specified pull requests using labels. Refer to Include Pull Requests to learn more about this option.
exclude-contributors Optional Exclude specific usernames from the generated $CONTRIBUTORS variable. Refer to Exclude Contributors to learn more about this option.
no-contributors-template Optional The template to use for $CONTRIBUTORS when there's no contributors to list. Default: "No contributors".
replacers Optional Search and replace content in the generated changelog body. Refer to Replacers to learn more about this option.
sort-by Optional Sort changelog by merged_at or title. Can be one of: merged_at, title. Default: merged_at.
sort-direction Optional Sort changelog in ascending or descending order. Can be one of: ascending, descending. Default: descending.
prerelease Optional Whether to draft a prerelease, with changes since another prerelease (if applicable). Default false.
prerelease-identifier Optional A string indicating an identifier (alpha, beta, rc, etc), to increment the prerelease version. This automatically enables prerelease if not already set to true. Default ''.
latest Optional Mark the release as latest. Only works for published releases. Can be one of: true, false, legacy. Default true.
version-resolver Optional Adjust the $RESOLVED_VERSION variable using labels. Refer to Version Resolver to learn more about this
commitish Optional The release target, i.e. branch or commit it should point to. Default: the ref that release-drafter runs for, e.g. refs/heads/master if configured to run on pushes to master.
filter-by-commitish Optional Filter previous releases to consider only those with the target matching commitish. Default: false.
include-paths Optional Restrict pull requests included in the release notes to only the pull requests that modified any of the paths in this array. Supports files and directories. Default: []
pull-request-limit Optional Limit for associatedPullRequests API call. Use this when working with long-lived non-default branches. See #1354. Default: 5
history-limit Optional Size of the pagination window when walking the repo. Can avoid erratic 502s from Github. Default: 15
initial-commits-since Optional When drafting your first release, limit the amount of scanned commits. Expects an ISO 8601 date, ex: "2025-06-18T10:29:51Z". Default: "" (unlimited)

Release Drafter also supports Probot Config, if you want to store your configuration files in a central repository. This allows you to share configurations between projects, and create a organization-wide configuration file by creating a repository named .github with the file .github/release-drafter.yml.

Template Variables

You can use any of the following variables in your template, header and footer:

Variable Description
$CHANGES The markdown list of pull requests that have been merged.
$CONTRIBUTORS A comma separated list of contributors to this release (pull request authors, commit authors, and commit committers).
$PREVIOUS_TAG The previous releasess tag.
$REPOSITORY Current Repository
$OWNER Current Repository Owner

Category Template Variables

You can use any of the following variables in category-template:

Variable Description
$TITLE The category title, e.g. Features.

Next Version Variables

You can use any of the following variables in your template, header, footer, name-template and tag-template:

Variable Description
$NEXT_PATCH_VERSION The next patch version number. For example, if the last tag or release was v1.2.3, the value would be v1.2.4. This is the most commonly used value.
$NEXT_MINOR_VERSION The next minor version number. For example, if the last tag or release was v1.2.3, the value would be v1.3.0.
$NEXT_MAJOR_VERSION The next major version number. For example, if the last tag or release was v1.2.3, the value would be v2.0.0.
$RESOLVED_VERSION The next resolved version number, based on GitHub labels. Refer to Version Resolver to learn more about this.

Version Template Variables

You can use any of the following variables in version-template to format the $NEXT_{PATCH,MINOR,MAJOR}_VERSION variables:

Variable Description
$PATCH The patch version number.
$MINOR The minor version number.
$MAJOR The major version number.
$COMPLETE The complete version string (including any prerelease info).

Version Resolver

With the version-resolver option version number incrementing can be resolved automatically based on labels of individual pull requests. Append the following to your .github/release-drafter.yml file:

version-resolver:
  major:
    labels:
      - 'major'
  minor:
    labels:
      - 'minor'
  patch:
    labels:
      - 'patch'
  default: patch

The above config controls the output of the $RESOLVED_VERSION variable.

If a pull requests is found with the label major/minor/patch, the corresponding version key will be incremented from a semantic version. The maximum out of major, minor and patch found in any of the pull requests will be used to increment the version number. If no pull requests are found with the assigned labels, the default will be assigned.

Change Template Variables

You can use any of the following variables in change-template:

Variable Description
$NUMBER The number of the pull request, e.g. 42.
$TITLE The title of the pull request, e.g. Add alien technology. Any characters excluding @ and # matching change-title-escapes will be prepended with a backslash so that they will appear verbatim instead of being interpreted as markdown format characters. @s and #s if present in change-title-escapes will be appended with an HTML comment so that they don't become mentions.
$AUTHOR The pull request authors username, e.g. gracehopper.
$BODY The body of the pull request e.g. Fixed spelling mistake.
$URL The URL of the pull request e.g. https://github.com/octocat/repo/pull/42.
$BASE_REF_NAME The base name of of the base Ref associated with the pull request e.g. master.
$HEAD_REF_NAME The head name of the head Ref associated with the pull request e.g. my-bug-fix.

References

Note: This is only relevant for GitHub app users as references is ignored when running as GitHub action due to GitHub workflows more powerful on conditions

References takes an list and accepts strings and regex. If none are specified, we default to the repositorys default branch usually master.

references:
  - master
  - v.+

Currently matching against any ref/heads/ and ref/tags/ references behind the scene

Categorize Pull Requests

With the categories option you can categorize pull requests in release notes using labels. For example, append the following to your .github/release-drafter.yml file:

categories:
  - title: '🚀 Features'
    label: 'feature'
  - title: '🐛 Bug Fixes'
    labels:
      - 'fix'
      - 'bugfix'
      - 'bug'

Pull requests with the label "feature" or "fix" will now be grouped together:

Screenshot of generated draft release with categories

Adding such labels to your PRs can be automated by using the embedded Autolabeler functionality (see below), PR Labeler or Probot Auto Labeler.

Optionally you can add a collapse-after entry to your category item, if the category has more than the defined collapse-after pull requests then it will show all pull requests collapsed for that category. Append the collapse-after integer to your category as following:

categories:
  - title: '⬆️ Dependencies'
    collapse-after: 3
    labels:
      - 'dependencies'

Exclude Pull Requests

With the exclude-labels option you can exclude pull requests from the release notes using labels. For example, append the following to your .github/release-drafter.yml file:

exclude-labels:
  - 'skip-changelog'

Pull requests with the label "skip-changelog" will now be excluded from the release draft.

Include Pull Requests

With the include-labels option you can specify pull requests from the release notes using labels. Only pull requests that have the configured labels will be included in the release draft. For example, append the following to your .github/release-drafter.yml file:

include-labels:
  - 'app-foo'

Pull requests with the label "app-foo" will be the only pull requests included in the release draft.

Exclude Contributors

By default, the $CONTRIBUTORS variable will contain the names or usernames of all the contributors of a release. The exclude-contributors option allows you to remove certain usernames from that list. This can be useful if don't wish to include yourself, to better highlight only the third-party contributions.

exclude-contributors:
  - 'myusername'

Replacers

You can search and replace content in the generated changelog body, using regular expressions, with the replacers option. Each replacer is applied in order.

replacers:
  - search: '/CVE-(\d{4})-(\d+)/g'
    replace: 'https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-$1-$2'
  - search: 'myname'
    replace: 'My Name'

Autolabeler

You can add automatically a label into a pull request, with the autolabeler option. Available matchers are files (glob), branch (regex), title (regex) and body (regex). Matchers are evaluated independently; the label will be set if at least one of the matchers meets the criteria.

autolabeler:
  - label: 'chore'
    files:
      - '*.md'
    branch:
      - '/docs{0,1}\/.+/'
  - label: 'bug'
    branch:
      - '/fix\/.+/'
    title:
      - '/fix/i'
  - label: 'enhancement'
    branch:
      - '/feature\/.+/'
    body:
      - '/JIRA-[0-9]{1,4}/'

Prerelease workflow

Release draft supports working with prereleases. It expects your workflow to be :

  • A stable release is published, ex: v3.5.0
  • You merge or add meaningful changes your users may want to see, but you are not quite ready for production
  • You publish a prerelease, ex: v3.5.0-rc.1
  • You merge more changes
  • You publish another prerelease, ex: v3.5.0-rc.2
  • You decide code is ready for production, you publish v3.5.1 (or another increment based on your changes)

With release-drafter, you can draft each of these releases and prereleases with the appropriate content using parameter 'prerelease' and 'prerelease-identifier' - available as either an input of from the config-file.

jobs:
  update_full_release_draft:
    runs-on: ubuntu-latest
    steps:
      - uses: release-drafter/release-drafter@v6
        with:
          prerelease: false # the default
          # ... rest of your config
  update_prerelease_draft:
    runs-on: ubuntu-latest
    steps:
      - uses: release-drafter/release-drafter@v6
        with:
          prerelease: true
          prerelease-identifier: 'rc' # Use semver identifiers : alpha, beta, rc, etc

Here, both jobs run in parallel every time you add changes to the configured branch.

  • update_full_release_draft will pile-up changes since v3.5.0 inside a draft for v3.5.1 (or v3.6.0 or v4.0.0, depending on your config)
  • update_prerelease_draft will pile-up changes since the last prerelease in a prerelease-draft. Changes are :
    • if no previous (published) prereleases are found - changes since v3.5.0 in a draft for v3.5.0-rc.1 (prerelease-draft)
    • or if v3.5.0-rc.1 exists (published) already - changes since v3.5.0-rc.1 in a draft for v3.5.0-rc.2 (prerelease-draft)

Some users like to run update_prerelease_draft with publish: true, such as prereleases are published immediately without the need for human intervention (or an external automation). Since prereleases are not meant to be stable in the first place, automation may be an acceptable risk for you too.

Important

  • The include-pre-releases config was deprecated in v6.3.0. See #1515
  • prerelease-identifier is not required when prerelease is enabled, but your prerelease will be named after / be associated with a tag that is not semver-compliant to actual prereleases.
  • when specified prerelease-identifier enables prerelease: true

Projects that don't use Semantic Versioning

If your project doesn't follow Semantic Versioning you can still use Release Drafter, but you may want to set the version-template option to customize how the $NEXT_{PATCH,MINOR,MAJOR}_VERSION environment variables are generated.

For example, if your project doesn't use patch version numbers, you can set version-template to $MAJOR.$MINOR. If the current release is version 1.0, then $NEXT_MINOR_VERSION will be 1.1.

Action Inputs

The Release Drafter GitHub Action accepts a number of optional inputs directly in your workflow configuration. These will typically override default behavior specified in your release-drafter.yml config.

Input Description
config-name If your workflow requires multiple release-drafter configs it be helpful to override the config-name. The config should still be located inside .github as that's where we are looking for config files.
name The name that will be used in the GitHub release that's created or updated. This will override any name-template specified in your release-drafter.yml if defined.
tag The tag name to be associated with the GitHub release that's created or updated. This will override any tag-template specified in your release-drafter.yml if defined.
version The version to be associated with the GitHub release that's created or updated. This will override any version calculated by the release-drafter.
publish A boolean indicating whether the release being created or updated should be immediately published. This may be useful if the output of a previous workflow step determines that a new version of your project has been (or will be) released, as with salsify/action-detect-and-tag-new-version.
prerelease Whether to draft a prerelease, with changes since another prerelease (if applicable). Default false.
prerelease-identifier A string indicating an identifier (alpha, beta, rc, etc), to increment the prerelease version. This automatically enables prerelease if not already set to true. Default ''.
latest A string indicating whether the release being created or updated should be marked as latest.
commitish A string specifying the target branch for the release being created.
header A string that would be added before the template body.
footer A string that would be added after the template body.
initial-commits-since When drafting your first release, limit the amount of scanned commits. Expects an ISO 8601 date, ex: "2025-06-18T10:29:51Z". Default: "" (unlimited)
disable-releaser A boolean indicating whether the releaser mode is disabled.
disable-autolabeler A boolean indicating whether the autolabeler mode is disabled.

Action Outputs

The Release Drafter GitHub Action sets a couple of outputs which can be used as inputs to other Actions in the workflow (example).

Output Description
id The ID of the release that was created or updated.
name The name of this release.
tag_name The name of the tag associated with this release.
body The body of the drafted release, useful if it needs to be included in files.
html_url The URL users can navigate to in order to view the release. i.e. https://github.com/octocat/Hello-World/releases/v1.0.0.
upload_url The 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.
resolved_version Version resolved by Version Resolver. i.e. 6.3.1
major_version Major part of resolved version by Version Resolver. i.e. 6 for version 6.3.1
minor_version Minor part of resolved version by Version Resolver. i.e. 3 for version 6.3.1
patch_version Patch part of resolved version by Version Resolver. i.e. 1 for version 6.3.1

Developing

If you have Node v10+ installed locally, you can run the tests, and a local app, using the following commands:

# Install dependencies
npm install

# Run the tests
npm run test

# Run the app locally
npm run test:watch

Once you've started the app, visit localhost:3000 and you'll get step-by-step instructions for installing it in your GitHub account so you can start pushing commits and testing it locally.

If you dont have Node installed, you can use Docker Compose:

# Run the tests
docker compose run --rm app

Contributing

Third-party contributions are welcome! 🙏🏼 See CONTRIBUTING.md for step-by-step instructions.

If you need help or have a question, let me know via a GitHub issue.

Deployment

If you want to deploy your own copy of Release Drafter, follow the Probot Deployment Guide.

Releasing

Run the following command:

git checkout master
git pull
npm version [major | minor | patch] -m "chore: release %s"

Important

You may want the version increment to correspond to the last drafted release. You can use a verison number instead of major | minor | patch if needed.

The command does the following:

  • Run tests (preversion script)
  • Bumps the version number in package.json and create corresponding tag
  • Stage changes for git (version script)
  • Commit and tag
  • Push & push tag (postversion script)

After pushing, the release.yml workflow will trigger (on: push: tag), and :

  • publish to npmjs
  • publish the release draft
  • update major tag (ex: pushing v6.2.1 bumps v6 to the same commit)