aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2021-09-30 17:08:36 +0200
committerGitHub <noreply@github.com>2021-09-30 08:08:36 -0700
commit7152353ade96a06235543d29a838701abd7292e2 (patch)
tree2d8245d1b895882e5367460b27f895204381f197
parent270cc1d70fa8e24299b6df13712b49216fe324ec (diff)
downloadrneovim-7152353ade96a06235543d29a838701abd7292e2.tar.gz
rneovim-7152353ade96a06235543d29a838701abd7292e2.tar.bz2
rneovim-7152353ade96a06235543d29a838701abd7292e2.zip
ci: add type and scope from PR title as labels #15850
This only works if the label exists in the first place of course.
-rw-r--r--.github/workflows/labeler.yml16
1 files changed, 16 insertions, 0 deletions
diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml
index 67ad4c0552..c7a331c657 100644
--- a/.github/workflows/labeler.yml
+++ b/.github/workflows/labeler.yml
@@ -12,3 +12,19 @@ jobs:
- uses: actions/labeler@main
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
+ type-scope:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: write
+ pull-requests: write
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ steps:
+ - uses: actions/checkout@v2.3.1
+ - run: gh pr checkout ${{ github.event.pull_request.number }}
+
+ # Extract type and try to add it as a label
+ - run: gh pr edit --add-label "$(echo "${{ github.event.pull_request.title }}" | sed -E 's|([[:alpha:]]+)(\(.*\))?:.*|\1|')" || true
+
+ # Extract scope and try to add it as a label
+ - run: gh pr edit --add-label "$(echo "${{ github.event.pull_request.title }}" | sed -E 's|[[:alpha:]]+\((.+)\):.*|\1|')" || true