issues_and_pull_requests.yml 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # https://docs.github.com/en/actions
  2. name: "Issues and Pull Requests"
  3. on:
  4. # Allow running on demand using Github UI
  5. workflow_dispatch:
  6. schedule:
  7. - cron: "0 12 * * *"
  8. env:
  9. CLOSE_MESSAGE: >-
  10. 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.
  11. If you're still interested in this, please let as know, we can consider re-opening it.
  12. DAYS_BEFORE_ISSUE_CLOSE: 30
  13. DAYS_BEFORE_ISSUE_STALE: 90
  14. DAYS_BEFORE_PR_CLOSE: 14
  15. DAYS_BEFORE_PR_STALE: 90
  16. STALE_CLARIFICATION: >-
  17. The purpose of this action is to enforce backlog review once in a while.
  18. This is mostly for maintainers and helps with keeping repository in good condition,
  19. because stale issues and PRs can accumulate over time and make it harder for others to find relevant information.
  20. 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.
  21. This action helps with periodic review and closing of such stale items in automated way.
  22. You may let maintainers handle this or verify current relevancy by yourself, to help with re-triage.
  23. Any activity will remove stale label so it won't be automatically closed at this point.
  24. jobs:
  25. handle_stale:
  26. name: "Handle stale state"
  27. runs-on: "ubuntu-latest"
  28. # See: https://github.com/actions/stale#recommended-permissions
  29. permissions:
  30. contents: write # only for delete-branch option
  31. issues: write
  32. pull-requests: write
  33. steps:
  34. # Config reference: https://github.com/actions/stale
  35. - name: "Handle stale issues and pull requests"
  36. uses: "actions/stale@v9"
  37. with:
  38. close-issue-message: "${{ env.CLOSE_MESSAGE }}"
  39. 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."
  40. close-pr-label: "status/to recover"
  41. days-before-issue-close: "${{ env.DAYS_BEFORE_ISSUE_CLOSE }}"
  42. days-before-issue-stale: "${{ env.DAYS_BEFORE_ISSUE_STALE }}"
  43. days-before-pr-close: "${{ env.DAYS_BEFORE_PR_CLOSE }}"
  44. days-before-pr-stale: "${{ env.DAYS_BEFORE_PR_STALE }}"
  45. exempt-all-milestones: true
  46. exempt-issue-labels: "topic/core"
  47. exempt-pr-labels: "topic/core"
  48. labels-to-add-when-unstale: "status/to verify"
  49. repo-token: "${{ secrets.GITHUB_TOKEN }}"
  50. stale-issue-label: "status/stale"
  51. stale-issue-message: |
  52. Since this issue has not had any activity within the last ${{ env.DAYS_BEFORE_ISSUE_STALE }} days, I have marked it as stale.
  53. ${{ env.STALE_CLARIFICATION }}
  54. I will close it if no further activity occurs within the next ${{ env.DAYS_BEFORE_ISSUE_CLOSE }} days.
  55. stale-pr-label: "status/stale"
  56. stale-pr-message: |
  57. Since this pull request has not had any activity within the last ${{ env.DAYS_BEFORE_PR_STALE }} days, I have marked it as stale.
  58. ${{ env.STALE_CLARIFICATION }}
  59. I will close it if no further activity occurs within the next ${{ env.DAYS_BEFORE_PR_CLOSE }} days.
  60. Please keep your branch up-to-date by rebasing it when main branch is ahead of it, thanks in advance!