-
Notifications
You must be signed in to change notification settings - Fork 1.3k
55 lines (50 loc) · 2.15 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
46
47
48
49
50
51
52
53
54
55
name: Close and mark stale issues, and draft PRs
on:
schedule:
- cron: '0 12 * * *'
workflow_dispatch:
permissions:
contents: read
jobs:
stale:
permissions:
issues: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
repo-token: ${{ github.token }}
stale-issue-message: 'We needed more information for this issue, please comment with more details or this issue will be closed in 72 hours.'
close-issue-message: 'This issue was closed because it is missing author input.'
stale-pr-message: 'Thank you for submitting the PR and contributing to lotus! Lotus maintainers need more of your input before merging it, please address the suggested changes or reply to the comments or this PR will be closed in 72 hours. You are always more than welcome to reopen the PR later as well!'
close-pr-message: 'This PR was closed because it is missing author input. Please feel free to reopen the PR when you get to it! Thank you for your interest in contributing to lotus!'
stale-issue-label: 'kind/stale'
stale-pr-label: 'kind/stale'
any-of-labels: 'need/author-input '
days-before-issue-stale: 3
days-before-issue-close: 3
days-before-pr-stale: 5
days-before-pr-close: 3
draft-days-before-stale: 1050 # 35 months * 30 days
draft-days-before-close: -1 # Don't automatically close draft PRs
remove-stale-when-updated: true
enable-statistics: true
mark-stale-draft-prs:
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Mark stale draft PRs
env:
GH_TOKEN: ${{ github.token }}
run: |
# Calculate cutoff date for last update (365 days ago)
cutoff_date=$(date -d "365 days ago" +%Y-%m-%d)
prs=$(gh pr list --repo $GITHUB_REPOSITORY --state open \
--json number,updatedAt,isDraft \
--jq ".[] | select(.isDraft) | select(.updatedAt < \"$cutoff_date\") | .number")
for pr in $prs; do
echo "Marking PR #$pr as stale"
gh pr edit $pr --add-label "kind/stale"
done