From 0f35803196247f5cba7549b38b0f4d029909026b Mon Sep 17 00:00:00 2001 From: boc-the-git <3479092+boc-the-git@users.noreply.github.com> Date: Wed, 11 Sep 2024 00:23:23 +1000 Subject: [PATCH] feat: Add autolabeler functionality for PRs (#4188) --- .github/release-drafter.yml | 18 ++++++++++++++++-- .github/workflows/release-drafter.yml | 9 +++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index b20f603c8d9..1801337a5a9 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -50,8 +50,22 @@ version-resolver: default: patch template: | - # 🍴🍴🍴🍴🍴🍴🍴🍴🍴🍴 + # 🍴🍴🍴🍴🍴🍴 $CHANGES - # 🍴🍴🍴🍴🍴🍴🍴🍴🍴🍴 + # 🍴🍴🍴🍴🍴🍴 + +autolabeler: + - label: 'feature' + title: + - '/feat/i' + - label: 'bugfix' + title: + - '/fix/i' + - label: 'documentation' + title: + - '/docs/i' + - label: 'chore' + title: + - '/chore/i' diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 1c8f998c904..10fd8a7285e 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -5,6 +5,12 @@ on: push: branches: - mealie-next + # pull_request event is required for autolabeler + pull_request: + types: [opened, labeled, unlabeled, reopened, synchronize] + # pull_request_target event is required for autolabeler to support PRs from forks + pull_request_target: + types: [opened, labeled, unlabeled, reopened, synchronize] workflow_dispatch: jobs: @@ -12,6 +18,9 @@ jobs: 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 name: ✏️ Draft release runs-on: ubuntu-latest steps: