From 3409de774c53e771f15527766fd8e823fe354228 Mon Sep 17 00:00:00 2001 From: Jagjeevan Kashid Date: Tue, 24 Feb 2026 06:12:07 +0530 Subject: [PATCH] feat:PR-rate-limit (#19804) Signed-off-by: Jagjeevan Kashid Co-authored-by: kevinjwang1 Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Christian Gunderman Co-authored-by: Tommaso Sciortino --- .github/scripts/pr-triage.sh | 2 +- .github/workflows/pr-rate-limiter.yaml | 31 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pr-rate-limiter.yaml diff --git a/.github/scripts/pr-triage.sh b/.github/scripts/pr-triage.sh index e6521376ce..92200ee4d2 100755 --- a/.github/scripts/pr-triage.sh +++ b/.github/scripts/pr-triage.sh @@ -22,7 +22,7 @@ get_issue_labels() { # Check cache case "${ISSUE_LABELS_CACHE_FLAT}" in *"|${ISSUE_NUM}:"*) - local suffix="${ISSUE_LABELS_CACHE_FLAT#*|${ISSUE_NUM}:}" + local suffix="${ISSUE_LABELS_CACHE_FLAT#*|"${ISSUE_NUM}":}" echo "${suffix%%|*}" return ;; diff --git a/.github/workflows/pr-rate-limiter.yaml b/.github/workflows/pr-rate-limiter.yaml new file mode 100644 index 0000000000..c58cf60a62 --- /dev/null +++ b/.github/workflows/pr-rate-limiter.yaml @@ -0,0 +1,31 @@ +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json + +name: 'PR rate limiter' + +permissions: {} + +on: + pull_request_target: + types: + - 'opened' + - 'reopened' + +jobs: + limit: + runs-on: 'gemini-cli-ubuntu-16-core' + permissions: + contents: 'read' + pull-requests: 'write' + steps: + - name: 'Limit open pull requests per user' + uses: 'Homebrew/actions/limit-pull-requests@9ceb7934560eb61d131dde205a6c2d77b2e1529d' # master + with: + except-author-associations: | + MEMBER + OWNER + comment-limit: 8 + comment: > + You already have 7 pull requests open. Please work on getting + existing PRs merged before opening more. + close-limit: 8 + close: true