forked from PHP-CS-Fixer/PHP-CS-Fixer
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (60 loc) · 3.29 KB
/
issues_and_pull_requests.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
66
67
68
69
70
71
72
73
74
# https://docs.github.com/en/actions
name: "Issues and Pull Requests"
on:
# Allow running on demand using Github UI
workflow_dispatch:
schedule:
- cron: "0 12 * * *"
env:
CLOSE_MESSAGE: >-
The fact this was automatically closed doesn't mean that the idea got rejected - it simply didn't get any priority for way too long to keep it open.
If you're still interested in this, please let as know, we can consider re-opening it.
DAYS_BEFORE_ISSUE_CLOSE: 30
DAYS_BEFORE_ISSUE_STALE: 90
DAYS_BEFORE_PR_CLOSE: 14
DAYS_BEFORE_PR_STALE: 90
STALE_CLARIFICATION: >-
The purpose of this action is to enforce backlog review once in a while.
This is mostly for maintainers and helps with keeping repository in good condition,
because stale issues and PRs can accumulate over time and make it harder for others to find relevant information.
It is also possible that some changes has been made to the repo already, and issue or PR became outdated, but wasn't closed for some reason.
This action helps with periodic review and closing of such stale items in automated way.
You may let maintainers handle this or verify current relevancy by yourself, to help with re-triage.
Any activity will remove stale label so it won't be automatically closed at this point.
jobs:
handle_stale:
name: "Handle stale state"
runs-on: "ubuntu-latest"
# See: https://github.com/actions/stale#recommended-permissions
permissions:
contents: write # only for delete-branch option
issues: write
pull-requests: write
steps:
# Config reference: https://github.com/actions/stale
- name: "Handle stale issues and pull requests"
uses: "actions/stale@v9"
with:
close-issue-message: "${{ env.CLOSE_MESSAGE }}"
close-pr-message: "${{ env.CLOSE_MESSAGE }} When it comes to pull requests it may be better to create new one, on top of main branch."
close-pr-label: "status/to recover"
days-before-issue-close: "${{ env.DAYS_BEFORE_ISSUE_CLOSE }}"
days-before-issue-stale: "${{ env.DAYS_BEFORE_ISSUE_STALE }}"
days-before-pr-close: "${{ env.DAYS_BEFORE_PR_CLOSE }}"
days-before-pr-stale: "${{ env.DAYS_BEFORE_PR_STALE }}"
exempt-all-milestones: true
exempt-issue-labels: "topic/core"
exempt-pr-labels: "topic/core"
labels-to-add-when-unstale: "status/to verify"
repo-token: "${{ secrets.GITHUB_TOKEN }}"
stale-issue-label: "status/stale"
stale-issue-message: |
Since this issue has not had any activity within the last ${{ env.DAYS_BEFORE_ISSUE_STALE }} days, I have marked it as stale.
${{ env.STALE_CLARIFICATION }}
I will close it if no further activity occurs within the next ${{ env.DAYS_BEFORE_ISSUE_CLOSE }} days.
stale-pr-label: "status/stale"
stale-pr-message: |
Since this pull request has not had any activity within the last ${{ env.DAYS_BEFORE_PR_STALE }} days, I have marked it as stale.
${{ env.STALE_CLARIFICATION }}
I will close it if no further activity occurs within the next ${{ env.DAYS_BEFORE_PR_CLOSE }} days.
Please keep your branch up-to-date by rebasing it when main branch is ahead of it, thanks in advance!