-
Notifications
You must be signed in to change notification settings - Fork 76
46 lines (41 loc) · 1.68 KB
/
stale.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
name: Stale Issues
on:
schedule:
- cron: "30 1 * * *"
workflow_dispatch:
permissions:
contents: read
jobs:
close-stale-issues:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@6f05e4244c9a0b2ed3401882b05d701dd0a7289b
with:
days-before-issue-stale: 3
days-before-issue-close: 3
stale-issue-label: "to-be-closed"
exempt-issue-labels: "in-progress"
close-issue-reason: "completed"
stale-issue-message: "This case has been marked as 'to-be-closed', since it has no activity for the 3 days.<br />It will be automatically closed in another 3 days of inactivity."
close-issue-message: "This case has been closed, since it has no activity for the last 6 days. Feel free to reopen it, if you need more help."
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Remove 'to-be-closed' label from closed issues
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { repo, owner } = context.repo;
const labelToRemove = "to-be-closed";
const query = `is:issue is:closed label:"${labelToRemove}" repo:${owner}/${repo}`;
const issues = await github.paginate(github.rest.search.issuesAndPullRequests, { q: query });
for (const issue of issues) {
await github.rest.issues.removeLabel({
owner,
repo,
issue_number: issue.number,
name: labelToRemove,
});
}