-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (55 loc) · 1.64 KB
/
released_or_not.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
54
55
56
57
58
59
on:
issue_comment:
types: [created]
jobs:
not-released:
runs-on: ubuntu-latest
steps:
- name: Check for /notreleased command
uses: actions/github-script@v7
with:
script: |
const comment = context.payload.comment.body;
if (comment.startsWith('/notreleased ')) {
return 'not released';
} else {
return null;
}
result-encoding: string
id: get-label
- uses: actions/github-script@v7
if: steps.get-label.outputs.result != 'null'
with:
script: |
const label = '${{ steps.get-label.outputs.result }}';
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [label]
})
released:
runs-on: ubuntu-latest
steps:
- name: Check for /released command
uses: actions/github-script@v7
with:
script: |
const comment = context.payload.comment.body;
if (comment.startsWith('/released ')) {
return 'released';
} else {
return null;
}
result-encoding: string
id: released
- uses: actions/github-script@v7
if: steps.released.outputs.result != 'null'
with:
script: |
github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: 'not released',
});