-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (36 loc) · 1.2 KB
/
auto-label-issues.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
35
36
name: Auto Label Issues
on:
issues:
types: [opened, edited]
jobs:
label_issues:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const issue = context.payload.issue;
const title = issue.title.toLowerCase();
const body = issue.body.toLowerCase();
const labels = [];
if (title.includes('gssoc') || body.includes('gssoc')) {
labels.push('GSSoC');
}
if (title.includes('enhancement') || body.includes('enhancement')) {
labels.push('Enhancement');
}
if (title.includes('bug') || body.includes('bug')) {
labels.push('Bug');
}
if (title.includes('documentation') || body.includes('documentation')) {
labels.push('Documentation');
}
if (labels.length > 0) {
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.name,
labels: labels
});
}