File tree 1 file changed +24
-1
lines changed
1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change 1
- name : Close and mark stale issue
1
+ name : Mark and close stale items
2
2
3
3
on :
4
4
schedule :
5
5
- cron : ' 0 12 * * *'
6
+ workflow_dispatch :
6
7
7
8
permissions :
8
9
contents : read
28
29
days-before-issue-close : 3
29
30
days-before-pr-stale : 5
30
31
days-before-pr-close : 3
32
+ draft-days-before-stale : 1050 # 35 months * 30 days
33
+ draft-days-before-close : -1 # Don't automatically close draft PRs
31
34
remove-stale-when-updated : true
32
35
enable-statistics : true
36
+
37
+ mark-stale-draft-prs :
38
+ permissions :
39
+ pull-requests : write
40
+ runs-on : ubuntu-latest
41
+ steps :
42
+ - name : Mark stale draft PRs
43
+ env :
44
+ GH_TOKEN : ${{ github.token }}
45
+ run : |
46
+ # Calculate cutoff date for last update (365 days ago)
47
+ cutoff_date=$(date -d "365 days ago" +%Y-%m-%d)
48
+ prs=$(gh pr list --repo $GITHUB_REPOSITORY --state open \
49
+ --json number,updatedAt,isDraft \
50
+ --jq ".[] | select(.isDraft) | select(.updatedAt < \"$cutoff_date\") | .number")
51
+
52
+ for pr in $prs; do
53
+ echo "Marking PR #$pr as stale"
54
+ gh pr edit $pr --add-label "kind/stale"
55
+ done
You can’t perform that action at this time.
0 commit comments