-
Notifications
You must be signed in to change notification settings - Fork 104
50 lines (45 loc) · 1.74 KB
/
label-feedback-from-comment.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
# BASED ON https://github.com/WordPress/Documentation-Issue-Tracker/blob/main/.github/workflows/actions-when-commented.yml
name: Label feedback based on command in comment
on:
issue_comment:
types: [created, edited]
jobs:
label_issues:
if: ${{ !github.event.issue.pull_request }}
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/[email protected]
with:
script: console.log(context)
- uses: actions/[email protected]
if: contains(github.event.issue.labels.*.name, 'Awaiting Triage') && contains(github.event.comment.body, '//content')
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["[Content] Feedback"]
})
- uses: actions/[email protected]
if: contains(github.event.issue.labels.*.name, 'Awaiting Triage') && contains(github.event.comment.body, '//dev')
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["[Type] Bug"]
})
- uses: actions/[email protected]
if: contains(github.event.issue.labels.*.name, 'Awaiting Triage') && contains(github.event.comment.body, '//handbook')
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["[Admin] Handbook"]
})