forked from neovim/neovim
-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (31 loc) · 937 Bytes
/
labeler_issue.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: "labeler: issue"
on:
issues:
types: [opened]
jobs:
labeler:
permissions:
issues: write
runs-on: ubuntu-latest
steps:
- name: check issue title
uses: actions/github-script@v7
with:
script: |
const title = context.payload.issue.title;
const titleSplit = title.split(/\s+/).map(e => e.toLowerCase());
const keywords = ['api', 'treesitter', 'ui', 'lsp'];
var match = new Set();
for (const keyword of keywords) {
if (titleSplit.includes(keyword)) {
match.add(keyword)
}
}
if (match.size !== 0) {
github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: Array.from(match)
})
}