From 0a605ccb12ae4253dff2cb8d9100420e81017b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 5 Aug 2020 16:24:12 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=E2=80=8D=EF=B8=8F=20Action=20based?= =?UTF-8?q?=20issue=20labeling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/issue_labeler.yml | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/issue_labeler.yml diff --git a/.github/workflows/issue_labeler.yml b/.github/workflows/issue_labeler.yml new file mode 100644 index 000000000..a8842872f --- /dev/null +++ b/.github/workflows/issue_labeler.yml @@ -0,0 +1,33 @@ +name: "Issue Labeler" +on: + issues: + types: [opened, edited] + +jobs: + apply-label: + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + let labels = []; + + if (context.payload.issue.title.match(/\[request\]|feature request/i)) { + labels.push('type:request'); + } + if (context.payload.issue.title.match(/\[brainstorming\]/i)) { + labels.push('type:brainstorming'); + } + if (context.payload.issue.title.match(/\[rc feedback\]/i)) { + labels.push('type:rc feedback'); + } + + if (labels.length > 0) { + github.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: labels + }) + }