From 9373bf2be0f3920119ac2202e126d99ab784d9a8 Mon Sep 17 00:00:00 2001 From: Anmol Baranwal <74038190+Anmol-Baranwal@users.noreply.github.com> Date: Fri, 14 Jul 2023 18:33:13 +0530 Subject: [PATCH 1/4] docs: add workflow to run labeler config file --- .github/workflows/add-labels-pr.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/add-labels-pr.yml diff --git a/.github/workflows/add-labels-pr.yml b/.github/workflows/add-labels-pr.yml new file mode 100644 index 000000000..370dd668e --- /dev/null +++ b/.github/workflows/add-labels-pr.yml @@ -0,0 +1,29 @@ +# reference: https://github.com/hoho4190/issue-pr-labeler +name: Issue PR Labeler + +on: + issues: + types: + - opened + - edited + pull_request_target: + types: + - opened + - reopened + +jobs: + main: + runs-on: ubuntu-latest + + permissions: + contents: read # to read configuration yml file + issues: write # to add labels to issues + pull-requests: write # to add labels to pull requests + + steps: + - name: Run Issue PR Labeler + uses: hoho4190/issue-pr-labeler@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + config-file-name: labeler-config.yml + # disable-bot: true # this will prevent issues, PRs created by bots From d45cd5518a061fc3527897065a797535deb94259 Mon Sep 17 00:00:00 2001 From: Anmol Baranwal <74038190+Anmol-Baranwal@users.noreply.github.com> Date: Fri, 14 Jul 2023 18:33:55 +0530 Subject: [PATCH 2/4] docs: add labeler config file that will analyse different section and add labels accordingly --- .github/labeler-config.yml | 80 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .github/labeler-config.yml diff --git a/.github/labeler-config.yml b/.github/labeler-config.yml new file mode 100644 index 000000000..deaa98ddd --- /dev/null +++ b/.github/labeler-config.yml @@ -0,0 +1,80 @@ +filters: + - label: 'goal: new-feature' + regexs: + - /\bfeat\b/ + - /feature/i + events: [pull_request] + targets: [title] + + - label: 'documentation' + regexs: + - /docs/i + events: [pull_request] + targets: [title] + + - label: 'bug' + regexs: + - /bug/i + events: [pull_request] + targets: [title] + - label: 'bug' + regexs: + - /fix/i + events: [pull_request] + targets: [title] + + - label: 'chore' + regexs: + - /category/i + events: [pull_request] + targets: [title] + - label: 'goal: new-category' + regexs: + - /category/i + events: [pull_request] + targets: [title] + + - label: 'chore' + regexs: + - /\blink\b/ + - /link/i + events: [pull_request] + targets: [title] + - label: 'goal: new-link' + regexs: + - /\blink\b/ + - /link/i + events: [pull_request] + targets: [title] + + - label: 'chore' + regexs: + - /description/i + events: [pull_request] + targets: [title] + + - label: 'chore' + regexs: + - /chore/i + events: [pull_request] + targets: [title] + + - label: 'goal: build' + regexs: + - /build/i + events: [pull_request] + targets: [title] + + - label: 'goal: refactor' + regexs: + - /\brefactor\b/ + - /refactor/i + events: [pull_request] + targets: [title] + + - label: 'accessibility' + regexs: + - /\brefactor\b/ + - /refactor/i + events: [issues, pull_request] # default + targets: [title, comment] # default From e2c6e44626cc0a5d4bfc7a089485c67e1b897d58 Mon Sep 17 00:00:00 2001 From: Anmol Baranwal <74038190+Anmol-Baranwal@users.noreply.github.com> Date: Fri, 14 Jul 2023 18:34:38 +0530 Subject: [PATCH 3/4] docs: change regex expression for accessibility --- .github/labeler-config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/labeler-config.yml b/.github/labeler-config.yml index deaa98ddd..279ff1153 100644 --- a/.github/labeler-config.yml +++ b/.github/labeler-config.yml @@ -74,7 +74,7 @@ filters: - label: 'accessibility' regexs: - - /\brefactor\b/ - - /refactor/i + - /\baccessibility\b/ + - /accessibility/i events: [issues, pull_request] # default targets: [title, comment] # default From 4191ddea83ff4c534102a28e9588e405b1145a3d Mon Sep 17 00:00:00 2001 From: Anmol Baranwal <74038190+Anmol-Baranwal@users.noreply.github.com> Date: Wed, 19 Jul 2023 12:33:47 +0530 Subject: [PATCH 4/4] docs: remove job action on issues --- .github/workflows/add-labels-pr.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/add-labels-pr.yml b/.github/workflows/add-labels-pr.yml index 370dd668e..92188d3b5 100644 --- a/.github/workflows/add-labels-pr.yml +++ b/.github/workflows/add-labels-pr.yml @@ -1,11 +1,7 @@ # reference: https://github.com/hoho4190/issue-pr-labeler -name: Issue PR Labeler +name: PR Labeler on: - issues: - types: - - opened - - edited pull_request_target: types: - opened @@ -17,11 +13,10 @@ jobs: permissions: contents: read # to read configuration yml file - issues: write # to add labels to issues pull-requests: write # to add labels to pull requests steps: - - name: Run Issue PR Labeler + - name: Run PR Labeler uses: hoho4190/issue-pr-labeler@v1 with: token: ${{ secrets.GITHUB_TOKEN }}