This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new 78490e99592 HDDS-11370. Use GitHub's stale action to auto-close
inactive pull requests (#9259)
78490e99592 is described below
commit 78490e99592d2498d957e44e4c49246dce5b5a89
Author: Sarveksha Yeshavantha Raju
<[email protected]>
AuthorDate: Mon Nov 10 16:27:05 2025 +0530
HDDS-11370. Use GitHub's stale action to auto-close inactive pull requests
(#9259)
---
.github/ci.md | 4 +--
.github/close-pending.sh | 41 ----------------------
.github/closing-message.txt | 7 ----
.../{close-pending.yaml => close-stale-prs.yaml} | 30 +++++++++-------
4 files changed, 20 insertions(+), 62 deletions(-)
diff --git a/.github/ci.md b/.github/ci.md
index fda4983d10a..4c8182a2877 100644
--- a/.github/ci.md
+++ b/.github/ci.md
@@ -73,8 +73,8 @@ If they don't match, it describes how to make the updates to
include the changes
- basic
- integration
-### close-prs Workflow
-[This](./workflows/close-pending.yaml) workflow is scheduled each night at
midnight; it closes PR's that have not been updated in the last 21 days, while
letting the author know they are free to reopen.
+### close-stale-prs Workflow
+[This](./workflows/close-stale-prs.yml) workflow is scheduled each night at
midnight and uses the [actions/stale](https://github.com/actions/stale) to
automatically manage inactive PRs. It marks PRs as stale after 21 days of
inactivity and closes them 7 days later. If a stale PR receives any updates or
comments, the stale label is automatically removed.
### comment-commands Workflow
[This](./workflows/comments.yaml) workflow is triggered each time a comment is
added/edited to a PR. It checks to see if the body of the comment begins with
one of the following strings and, if so, invokes the corresponding command.
diff --git a/.github/close-pending.sh b/.github/close-pending.sh
deleted file mode 100755
index 5ed27d31a10..00000000000
--- a/.github/close-pending.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/env bash
-# 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.
-
-set -e
-
-SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
-MESSAGE=$(cat $SCRIPT_DIR/closing-message.txt)
-
-while IFS= read -r number &&
- IFS= read -r title; do
- echo "Closing PR ($number): $title"
- curl -s -o /dev/null \
- -X POST \
- --data "$(jq --arg body "$MESSAGE" -n '{body: $body}')" \
- --header "authorization: Bearer $GITHUB_TOKEN" \
- --header 'content-type: application/json' \
- "https://api.github.com/repos/apache/ozone/issues/$number/comments"
-
- curl -s -o /dev/null \
- -X PATCH \
- --data '{"state": "close"}' \
- --header "authorization: Bearer $GITHUB_TOKEN" \
- --header 'content-type: application/json' \
- "https://api.github.com/repos/apache/ozone/pulls/$number"
-done < <(curl -H "Content-Type: application/json" \
- --header "authorization: Bearer $GITHUB_TOKEN" \
-
"https://api.github.com/search/issues?q=repo:apache/ozone+type:pr+updated:<$(date
-d "-21 days" +%Y-%m-%d)+label:pending+is:open" \
- | jq -r '.items[] | (.number,.title)')
diff --git a/.github/closing-message.txt b/.github/closing-message.txt
deleted file mode 100644
index 261eac275e0..00000000000
--- a/.github/closing-message.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Thank you very much for the patch. I am closing this PR __temporarily__ as
there was no activity recently and it is waiting for response from its author.
-
-It doesn't mean that this PR is not important or ignored: feel free to reopen
the PR at any time.
-
-It only means that attention of committers is not required. We prefer to keep
the review queue clean. This ensures PRs in need of review are more visible,
which results in faster feedback for all PRs.
-
-If you need ANY help to finish this PR, please [contact the
community](https://github.com/apache/hadoop-ozone#contact) on the mailing list
or the slack channel."
diff --git a/.github/workflows/close-pending.yaml
b/.github/workflows/close-stale-prs.yaml
similarity index 50%
rename from .github/workflows/close-pending.yaml
rename to .github/workflows/close-stale-prs.yaml
index 3dfe736cd39..6e4ef57f88f 100644
--- a/.github/workflows/close-pending.yaml
+++ b/.github/workflows/close-stale-prs.yaml
@@ -12,21 +12,27 @@
# 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-prs
+name: close-stale-prs
on:
schedule:
- - cron: '0 0 * * *'
+ - cron: '0 0 * * *'
jobs:
- close-pending:
- name: close-pending
- runs-on: ubuntu-24.04
+ close-stale-prs:
+ permissions:
+ pull-requests: write
+ runs-on: ubuntu-latest
steps:
- - name: Checkout code
- uses: actions/checkout@v4
- - name: Execute close-pending script
- if: github.repository == 'apache/ozone'
- run: ./.github/close-pending.sh
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ - name: Close Stale PRs
+ uses: actions/stale@v10
+ with:
+ stale-pr-label: 'stale'
+ exempt-draft-pr: false
+ days-before-issue-stale: -1
+ days-before-pr-stale: 21
+ days-before-pr-close: 7
+ remove-pr-stale-when-updated: true
+ operations-per-run: 150
+ stale-pr-message: 'This PR has been marked as stale due to 21 days
of inactivity. Please comment or remove the stale label to keep it open.
Otherwise, it will be automatically closed in 7 days.'
+ close-pr-message: 'Thank you for your contribution. This PR is being
closed due to inactivity. If needed, feel free to reopen it.'
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]