tempestphp / tempest-framework

The PHP framework that gets out of your way 🌊
https://tempestphp.com
MIT License
1.13k stars 80 forks source link

Add GitHub actions to close issues/pull requests #435

Open aidan-casey opened 2 months ago

aidan-casey commented 2 months ago

In our contributing guide, we articulate that issues will be closed after 30 days of no response. We should setup some GitHub actions to enforce this across issues and pull requests.

ericsizemore commented 3 weeks ago

Could probably come up with something using actions/stale.

If you all are good with using this particular action, the workflow would be rather simple:

name: "Close stale issues/pull requests."
on:
  schedule:
    - cron: "30 1 * * *"

jobs:
  close-issues:
    runs-on: ubuntu-latest
    permissions:
      issues: write
      pull-requests: write
    steps:
      - uses: actions/stale@v9
        with:
          days-before-stale: 30
          days-before-close: 1
          stale-issue-label: "stale"
          stale-issue-message: "This issue is stale because it has been open for 30 days with no activity."
          close-issue-message: "This issue was closed because it has been inactive for 1 day since being marked as stale."
          stale-pr-label: "stale"
          stale-pr-message: "This pull request is stale because it has been open for 30 days with no activity."
          close-pr-message:  "This pull request was closed because it has been inactive for 1 day since being marked as stale."
          repo-token: ${{ secrets.GITHUB_TOKEN }}

There are several options available. You can set different stale/close days for issues and PRs, or the same number of days (as is done above). Could whip up a PR for this if anyone has any recommendations on the messages used, or any other particular options/settings for the action.

ericsizemore commented 2 weeks ago

Any thoughts? :)

innocenzi commented 2 weeks ago

The action looks good to me, but it will close a lot of the backlog @brendt has built up in the issues, so we probably need to use one of the exempt options

Not sure if we should exempt using assignees or labels? Or maybe just clear the backlog before... it's never good to have a big backlog 😆

ericsizemore commented 2 weeks ago

Another option would be to use the start-date setting: https://github.com/marketplace/actions/close-stale-issues#start-date .

The action looks good to me, but it will close a lot of the backlog @brendt has built up in the issues, so we probably need to use one of the exempt options

Not sure if we should exempt using assignees or labels? Or maybe just clear the backlog before... it's never good to have a big backlog 😆

innocenzi commented 2 weeks ago

Ooh I missed that! That's better than the other options I think. 👍

Feel free to PR @ericsizemore

aidan-casey commented 2 weeks ago

Yeah, this is exactly what I had in mind!

ericsizemore commented 2 weeks ago

682 :)