-
-
Notifications
You must be signed in to change notification settings - Fork 190
65 lines (61 loc) · 2.01 KB
/
response.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
60
61
62
63
64
65
name: stale
on:
schedule:
- cron: '30 1 * * *' # Run every day at 01:30
issue_comment:
jobs:
stale:
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v9
with:
stale-issue-message: >
This has been labeled stale since a request for information has
not been answered for 30 days.
close-issue-message: >
This has been closed since it has been marked stale for 5 days.
It can be reopened when the requested information is provided.
days-before-stale: 30
days-before-close: 5
any-of-labels: needs response
remove_label:
if: github.event_name == 'issue_comment'
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/github-script@v7
with:
script: |
const issue = await github.rest.issues.get({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});
const author = issue.data.user.login;
const commenter = context.actor;
if (author === commenter) {
const labels = issue.data.labels.map((e) => e.name);
if (labels.includes("needs response")) {
github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: "needs response",
});
}
if (labels.includes("Stale")) {
github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: "Stale",
});
}
}