-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 1.5 KB
/
cron-stale-issues.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
name: Scheduler Remove Stale Issues
on:
schedule:
# https://crontab.guru/#20_18_*_*_6
- cron: "20 18 * * 6"
jobs:
close-stale-issue:
name: Close stale issues and PRs
runs-on:
[
self-hosted,
owner=cloud-platform-l4,
runnerset=default-runners,
env=staging,
opco=tokopedia,
]
permissions:
issues: write
contents: write
pull-requests: write
steps:
- uses: actions/stale@v6
timeout-minutes: 5
with:
days-before-close: 3
days-before-stale: 30
stale-pr-label: "no-pr-activity"
stale-issue-label: "no-issue-activity"
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-pr-message: "This PR has been inactive for more than 30 days, will close in 3 days."
stale-issue-message: "This Issue has been inactive for more than 30 days, will close in 3 days."
prune-stale-branch:
name: Delete stale branch
runs-on:
[
self-hosted,
owner=cloud-platform-l4,
runnerset=default-runners,
env=staging,
opco=tokopedia,
]
steps:
- uses: phpdocker-io/github-actions-delete-abandoned-branches@v1
id: delete-branch
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
ignore_branches: master,main
last_commit_age_days: 30
dry_run: no
- name: Output
run: "echo 'Deleted branches: ${{ steps.delete_stuff.outputs.deleted_branches }}'"