Skip to content

Commit

Permalink
release-drafter (#33)
Browse files Browse the repository at this point in the history
The auxiliary GH action to setup release drafts and update change log
accordingly. Configured with autolabeler, so the PRs will be labeled
according to the PR branch name and/or files changed:

| Branch name  | Files changed | Resulting label |
| ------------- | ------------- | ------------- |
| deps/*  |  | `dependencies`  |
| chore/*  |  | `chore`  |
| docs/* | **/*.md | `documentation` |
| enh/* |  | `enhancement` |
| feature/* |  | `feature` |
| fix/* |  | `bugfix` |
| bugfix/* |  | `bugfix` |
|  | /api/* | `api-change` |
|  | /internal/* | `controllers` |

Based on labels release draft will be updated with 'Features', 'Bug
Fixes' and 'Maintenance' categories which will include corresponding
PR's title.
It's also possible to manage release draft's version by applying
`major`, `minor` and `patch` labels on PR. By default the version will
be the next patch version after the last release, v0.0.1 if none.

---------

Signed-off-by: Artem Bortnikov <artem.bortnikov@telekom.com>
  • Loading branch information
aobort authored Mar 18, 2024
1 parent 34d962d commit 35238c6
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: 'Features'
labels:
- 'feature'
- 'enhancement'
- title: 'Bug Fixes'
labels:
- 'bugfix'
- title: 'Maintenance'
labels:
- 'chore'
- 'dependencies'
- 'documentation'
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
exclude-labels:
- 'skip-changelog'
autolabeler:
- label: 'api-change'
files:
- '/api/*'
- label: 'controllers'
files:
- '/internal/*'
- label: 'bugfix'
branch:
- '/fix\/.+/'
- '/bugfix\/.+/'
- label: 'feature'
branch:
- '/feature\/.+/'
- label: 'enhancement'
branch:
- '/enh\/.+/'
- label: 'chore'
branch:
- '/chore\/.+/'
- label: 'dependencies'
branch:
- '/deps\/.+/'
- label: 'documentation'
files:
- '**/*.md'
branch:
- '/docs\/.+/'
template: |
## Changes
$CHANGES
18 changes: 18 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Release Drafter

on:
workflow_dispatch:
push:
branches:
- main

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
with:
disable-releaser: github.ref != 'refs/heads/main'
config-name: release-drafter.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 35238c6

Please sign in to comment.