From a761b93b375e4bbd85a6870697e62b9ca2bd435b Mon Sep 17 00:00:00 2001 From: Vishesh Date: Fri, 16 Feb 2024 14:42:54 +0530 Subject: [PATCH 1/4] Github Action: Add action to auto close issues/PRs after a certain time --- .github/workflows/stale.yml | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 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 000000000000..a3618bf8e7b2 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,42 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +name: 'Close stale issues and PRs' +on: + schedule: + - cron: '30 1 * * *' + +jobs: + stale: + runs-on: ubuntu-latest + permissions: + actions: write + issues: write + pull-requests: write + steps: + - uses: actions/stale@v10 + with: + stale-issue-message: 'This issue is stale because it has been open for 120 days with no activity. Remove stale label or comment or this will be closed in 120 days.' + stale-pr-message: 'This PR is stale because it has been open for 120 days with no activity. Remove stale label or comment or this will be closed in 120 days.' + close-issue-message: 'This issue was closed because it has been stale for 120 days with no activity.' + close-pr-message: 'This PR was closed because it has been stale for 120 days with no activity.' + stale-issue-label: 'no-issue-activity' + stale-pr-label: 'no-pr-activity' + days-before-stale: 120 + days-before-close: 120 + exempt-issue-labels: 'gsoc,good-first-issue,long-term-plan' + exempt-pr-labels: 'status:ready-for-merge,status:needs-testing' From a73e267a46a964de90febb97874954deb3b7e1d9 Mon Sep 17 00:00:00 2001 From: Vishesh <8760112+vishesh92@users.noreply.github.com> Date: Tue, 16 Dec 2025 13:37:28 +0530 Subject: [PATCH 2/4] Apply suggestions from code review Co-authored-by: dahn Co-authored-by: Jonathan de Jong --- .github/workflows/stale.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index a3618bf8e7b2..4a247b45e67b 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -30,13 +30,12 @@ jobs: steps: - uses: actions/stale@v10 with: - stale-issue-message: 'This issue is stale because it has been open for 120 days with no activity. Remove stale label or comment or this will be closed in 120 days.' - stale-pr-message: 'This PR is stale because it has been open for 120 days with no activity. Remove stale label or comment or this will be closed in 120 days.' + stale-issue-message: 'This issue is stale because it has been open for 120 days with no activity. It may be removed by adminstrators of this project at any time. Remove the stale label or comment to request for removal of it to prevent this.' + stale-pr-message: 'This PR is stale because it has been open for 120 days with no activity. It may be removed by adminstrators of this project at any time. Remove the stale label or comment to request for removal of it to prevent this.' close-issue-message: 'This issue was closed because it has been stale for 120 days with no activity.' close-pr-message: 'This PR was closed because it has been stale for 120 days with no activity.' stale-issue-label: 'no-issue-activity' stale-pr-label: 'no-pr-activity' days-before-stale: 120 - days-before-close: 120 exempt-issue-labels: 'gsoc,good-first-issue,long-term-plan' exempt-pr-labels: 'status:ready-for-merge,status:needs-testing' From 114c0cd1d56bb452bbf97d99a1d7634ebc826c5f Mon Sep 17 00:00:00 2001 From: Vishesh <8760112+vishesh92@users.noreply.github.com> Date: Tue, 16 Dec 2025 14:39:43 +0530 Subject: [PATCH 3/4] Apply suggestion from @vishesh92 --- .github/workflows/stale.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 4a247b45e67b..38bda2bdb30c 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -30,8 +30,8 @@ jobs: steps: - uses: actions/stale@v10 with: - stale-issue-message: 'This issue is stale because it has been open for 120 days with no activity. It may be removed by adminstrators of this project at any time. Remove the stale label or comment to request for removal of it to prevent this.' - stale-pr-message: 'This PR is stale because it has been open for 120 days with no activity. It may be removed by adminstrators of this project at any time. Remove the stale label or comment to request for removal of it to prevent this.' + stale-issue-message: 'This issue is stale because it has been open for 120 days with no activity. It may be removed by administrators of this project at any time. Remove the stale label or comment to request for removal of it to prevent this.' + stale-pr-message: 'This PR is stale because it has been open for 120 days with no activity. It may be removed by administrators of this project at any time. Remove the stale label or comment to request for removal of it to prevent this.' close-issue-message: 'This issue was closed because it has been stale for 120 days with no activity.' close-pr-message: 'This PR was closed because it has been stale for 120 days with no activity.' stale-issue-label: 'no-issue-activity' From 22f874724be60c8ff788912e791aee4c1ea36a3a Mon Sep 17 00:00:00 2001 From: dahn Date: Wed, 17 Dec 2025 13:07:23 +0100 Subject: [PATCH 4/4] add on-hold --- .github/workflows/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 38bda2bdb30c..f12fbe93de66 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -38,4 +38,4 @@ jobs: stale-pr-label: 'no-pr-activity' days-before-stale: 120 exempt-issue-labels: 'gsoc,good-first-issue,long-term-plan' - exempt-pr-labels: 'status:ready-for-merge,status:needs-testing' + exempt-pr-labels: 'status:ready-for-merge,status:needs-testing,status:on-hold'