diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 6ca7d3a..5e970a2 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -11,10 +11,45 @@ categories: - 'kind/dependencies' - 'kind/project' +# Needs to contain all labels from above +include-labels: + - 'kind/enhancement' + - 'kind/bug' + - 'kind/chore' + - 'kind/dependencies' + - 'kind/project' + change-template: '- $TITLE (#$NUMBER)' change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. tag-template: 'v$RESOLVED_VERSION' name-template: 'v$RESOLVED_VERSION 🌈' +version-template: '$MAJOR.$MINOR' +autolabeler: + - label: 'kind/chore' + branch: + - '/chore\/.+/' + title: + - '/\[chore\]/i' + - label: 'kind/dependencies' + branch: + - '/dependencies\/.+/' + title: + - '/\[dependencies\]/i' + - label: 'kind/project' + branch: + - '/project\/.+/' + title: + - '/\[project\]/i' + - label: 'kind/bug' + branch: + - '/fix\/.+/' + title: + - '/\[fix\]/i' + - label: 'kind/enhancement' + branch: + - '/feature\/.+/' + title: + - '/\[feature\]/i' template: | # What's Changed @@ -28,19 +63,15 @@ template: | version-resolver: major: labels: - - 'major' - - 'breaking' + - 'disabled' minor: labels: - - 'minor' - - 'feature' - - 'status/enhancement' - - 'dependencies' + - 'kind/enhancement' + - 'kind/bug' + - 'kind/chore' + - 'kind/dependencies' + - 'kind/project' patch: labels: - - 'patch' - - 'fix' - - 'bugfix' - - 'status/bug' - - 'chore' + - 'disabled' default: patch diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index be1c7c9..763f680 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -6,13 +6,30 @@ on: # branches to consider in the event; optional, defaults to all branches: - main + # 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-20.04 steps: - uses: release-drafter/release-drafter@v5 with: + commitish: main config-name: release-drafter.yml env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}