diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 1b32944..520b2f1 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -66,49 +66,63 @@ categories: # Using regex for defining rules - https://regexr.com/ # https://stackoverflow.com/questions/58899999/regexp-to-match-conventional-commit-syntax +# Auto-labeler: Assign labels based on branch names or PR titles that follow Conventional Commits autolabeler: -- label: 'chore' +- label: 'feature' + branch: + - '/feat\/.+/' # Matches branch names starting with feat/ + title: + - '/feat\: .+/' # Matches PR titles starting with feat: +- label: 'bugfix' + branch: + - '/fix\/.+/' # Matches branch names starting with fix/ + title: + - '/fix\: .+/' # Matches PR titles starting with fix: +- label: 'documentation' branch: - - '(chore)(\([a-z ]+\))?\/.' + - '/docs\/.+/' # Matches branch names starting with docs/ title: - - '^(chore)(\([a-z ]+\))?: .' -- label: 'bug' + - '/docs\: .+/' # Matches PR titles starting with docs: +- label: 'style' branch: - - '(fix)(\([a-z ]+\))?\/.' + - '/style\/.+/' # Matches branch names starting with style/ title: - - '^(fix)(\([a-z ]+\))?: .' + - '/style\: .+/' # Matches PR titles starting with style: - label: 'refactor' branch: - - '(refactor)(\([a-z ]+\))?\/.' + - '/refactor\/.+/' # Matches branch names starting with refactor/ title: - - '^(refactor)(\([a-z ]+\))?: .' + - '/refactor\: .+/' # Matches PR titles starting with refactor: - label: 'test' branch: - - '(test)(\([a-z ]+\))?\/.' + - '/test\/.+/' # Matches branch names starting with test/ title: - - '^(test)(\([a-z ]+\))?: .' -- label: 'feature' + - '/test\: .+/' # Matches PR titles starting with test: +- label: 'chore' + branch: + - '/chore\/.+/' # Matches branch names starting with chore/ + title: + - '/chore\: .+/' # Matches PR titles starting with chore: +- label: 'performance' branch: - - '(feat)(\([a-z ]+\))?\/.' + - '/perf\/.+/' # Matches branch names starting with perf/ title: - - '^(feat)(\([a-z ]+\))?: .' -- label: 'ci/cd' + - '/perf\: .+/' # Matches PR titles starting with perf: +- label: 'ci' branch: - - '(ci)(\([a-z ]+\))?\/.' + - '/ci\/.+/' # Matches branch names starting with ci/ title: - - '^(ci)(\([a-z ]+\))?: .' -- label: 'minor' + - '/ci\: .+/' # Matches PR titles starting with ci: +- label: 'build' branch: - - '(feat)(\([a-z ]+\))?\/.' + - '/build\/.+/' # Matches branch names starting with build/ title: - - '^(feat)(\([a-z ]+\))?: .' -- label: 'patch' + - '/build\: .+/' # Matches PR titles starting with build: +- label: 'revert' branch: - - '(fix)(\([a-z ]+\))?\/.' - - '(ci)(\([a-z ]+\))?\/.' + - '/revert\/.+/' # Matches branch names starting with revert/ title: - - '^(fix)(\([a-z ]+\))?: .' - - '^(ci)(\([a-z ]+\))?: .' + - '/revert\: .+/' # Matches PR titles starting with revert: change-template: '- $TITLE @$AUTHOR (#$NUMBER)' change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. diff --git a/.github/workflows/release-drafter-labeler.yml b/.github/workflows/release-drafter-labeler.yml index cceaa98..eeba4fc 100644 --- a/.github/workflows/release-drafter-labeler.yml +++ b/.github/workflows/release-drafter-labeler.yml @@ -5,18 +5,23 @@ on: 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] jobs: auto-labeler: name: Release drafter Auto Labeler runs-on: ubuntu-latest + permissions: + # Setting up permissions in the workflow to limit the scope of what it can do. Optional! + contents: read + pull-requests: write + statuses: write + checks: write + steps: - uses: release-drafter/release-drafter@v6 with: config-name: release-drafter.yml + disable-autolabeler: false disable-releaser: true # only run auto-labeler for PRs env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 248cbfc..37f4857 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -26,6 +26,7 @@ jobs: id: semantic with: config-name: release-drafter.yml + disable-autolabeler: true ## Default versioning just increase the path version as default. but the can use minor, patch and breaking-changes labels to apply semver # version: 1.29.1 env: