From e4c0651b965241f5a21dec9530ed2d995c1ebbff Mon Sep 17 00:00:00 2001 From: Jaylin Lee <61487970+APX103@users.noreply.github.com> Date: Wed, 9 Aug 2023 16:26:05 +0800 Subject: [PATCH] feat(CI_workflow): Add PR & Issue auto remove workflow (#184) * feat(ci_workflow): Add PR & Issue auto remove workflow Add a workflow for stale PR & Issue auto remove - pr & issue well be labeled as stale for inactive in 7 days - staled PR & Issue well be remove in 7 days - run this workflow every day on 1:30 a.m. * Update stale.yml --- .github/workflows/stale.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..1c0cba4 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,32 @@ +name: 'Close stale issues and PRs' + +on: + schedule: + # check issue and pull request once at 01:30 a.m. every day + - cron: '30 1 * * *' + +permissions: + contents: read + +jobs: + stale: + permissions: + issues: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v7 + with: + stale-issue-message: 'This issue is marked as stale because it has been marked as invalid or awaiting response for 7 days without any further response. It will be closed in 7 days if the stale label is not removed or if there is no further response.' + stale-pr-message: 'This PR is marked as stale because there has been no activity in the past 7 days. It will be closed in 7 days if the stale label is not removed or if there is no further updates.' + close-issue-message: 'This issue is closed because it has been stale for 7 days. Please open a new issue if you have similar issues or you have any new updates now.' + close-pr-message: 'This PR is closed because it has been stale for 7 days. Please reopen this PR if you have any updates and want to keep contributing the code.' + # Labels on issues exempted from stale + exempt-issue-labels: "enhancement,planned" + days-before-issue-stale: 7 + days-before-pr-stale: 7 + days-before-issue-close: 7 + days-before-pr-close: 7 + # automatically remove the stale label when the issues or the pull requests are updated or commented + remove-stale-when-updated: true + operations-per-run: 50