forked from MudBlazor/MudBlazor
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (48 loc) · 2.19 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
on:
issues:
types: [opened]
jobs:
apply-label:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
script: |
const body = context.payload.issue.body;
let labels = [];
if (body.includes("- [X] I would like to do a Pull Request")) {
labels.push("wants to do a PR");
const author = context.payload.issue.user.login;
const comment = 'Thanks for wanting to do a PR, @' + author + ' !\n\nWe try to merge all non-breaking bugfixes and will deliberate the value of new features for the community. Please note there is no guarantee your pull request will be merged, so if you want to be sure before investing the work, feel free to contact the team first.'
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
})
github.rest.issues.addAssignees({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
assignees: [author]
})
console.log("Author wants to do a PR.");
}
if (body.includes("### Feature request type\n\nNew component")) {
labels.push("new component");
console.log("Feature request type: new component.");
} else if (body.includes("### Feature request type\n\nPerformance improvement")) {
labels.push("performance");
console.log("Feature request type: Performance improvement.");
} else if (body.includes("### Bug type\n\nDocs (mudblazor.com)")) {
labels.push("docs");
console.log("Bug type: docs.");
}
if(labels.length != 0) {
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: labels
})
}