forked from neovim/neovim
-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (32 loc) · 972 Bytes
/
issue-open-check.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
32
33
34
name: Issue Open Check
on:
issues:
types: [opened]
jobs:
issue-open-check:
permissions:
issues: write
runs-on: ubuntu-latest
steps:
- name: check issue title
id: check-issue
uses: actions/github-script@v6
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)
})
}