Skip to content

Commit a06e196

Browse files
authored
Merge pull request #57 from envato/hayelycodes/auto-close-stale-issues-and-prs
Added workflow for autoclosing "stale" PRs and issues
2 parents 130d1da + 0f2e924 commit a06e196

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## What Changed
2+
3+
4+
## Heads up!
5+
6+
PRs that go 60 days without activity may be automatically closed. See [these docs](https://github.com/envato/jwt_signed_request?tab=readme-ov-file#stale-prs) for more information.

.github/workflows/stale.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This workflow warns and then closes PRs that have had no activity for a specified amount of time.
2+
#
3+
# You can adjust the behavior by modifying this file.
4+
# For more information, see:
5+
# https://github.com/actions/stale
6+
name: Label and close stale pull requests
7+
8+
on:
9+
schedule:
10+
- cron: '0 0 * * *' # daily at midnight
11+
12+
jobs:
13+
stale:
14+
15+
runs-on: ubuntu-latest
16+
permissions:
17+
issues: write
18+
pull-requests: write
19+
20+
steps:
21+
- uses: actions/stale@v5
22+
with:
23+
repo-token: ${{ secrets.GITHUB_TOKEN }}
24+
stale-issue-message: 'This issue has had no activity for 60 days and is now considered stale. It will be closed in 7 days if there is no further activity.'
25+
stale-issue-label: 'stale-issue'
26+
stale-pr-message: 'This pull request has had no activity for 60 days and is now considered stale. It will be closed in 7 days if there is no further activity.'
27+
stale-pr-label: 'stale-pr'
28+
days-before-stale: 60
29+
days-before-close: 7 # Will be closed 7 days after being labelled if there is no further activity in that time
30+
exempt-issue-labels: 'do-not-auto-close' # allows us to allowlist issues that have a valid reason for no activity over a long period of time
31+
exempt-pr-labels: 'do-not-auto-close' # allows us to allowlist PRs that have a valid reason for no activity over a long period of time

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ then run:
2121
$ bundle
2222
```
2323

24+
## Stale PRs
25+
26+
We use the "stale" workflow to manage our PRs.
27+
If you have a PR open for 60 days without any activity, it will automatically be labelled `stale-pr`.
28+
If there is no activity for 7 days after this label is applied, the PR will be automatically closed.
29+
30+
If you have a PR that has a sensible reason for being open for a long period of time with no activity, you can apply the `do-not-auto-close` label to avoid it being automatically closed.
31+
2432
## Generating EC Keys
2533

2634
We should be using a public key encryption algorithm such as **ES256**. To generate your public/private key pair using **ES256** run:

0 commit comments

Comments
 (0)