mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-06 08:16:43 +00:00
The merged detector's 0.6 flag threshold had become the close bar, and 6 of the 7 real flagged pairs at 85% or more were not duplicates. The sweep now closes only when an older open issue has the identical normalized title, measures the grace period from the latest bot notice, and leaves the issue open when anyone replies or gives the notice a thumbs down. A reporter cannot reopen an issue the bot closed, so a reporter comment after the automatic close reopens it, drops the duplicate label, and asks for a human look. Manual dispatch defaults to a dry run and takes a grace_period_days input, the runner supplies the repository, the dead python closer is gone, and the decision core has bun tests on a PR-triggered job.
69 lines
2 KiB
YAML
69 lines
2 KiB
YAML
name: Auto-close duplicate issues
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 9 * * *"
|
|
workflow_dispatch:
|
|
inputs:
|
|
dry_run:
|
|
description: Log which issues would close without closing anything
|
|
type: boolean
|
|
default: true
|
|
grace_period_days:
|
|
description: Days a duplicate notice must go unanswered before the close
|
|
type: number
|
|
default: 3
|
|
pull_request:
|
|
paths:
|
|
- .github/workflows/auto-close-duplicates.yml
|
|
- scripts/auto-close-duplicates.ts
|
|
- scripts/auto-close-duplicates.test.ts
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
test:
|
|
if: github.event_name == 'pull_request'
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
|
|
with:
|
|
bun-version: "1.4.0"
|
|
|
|
- name: Test the sweep
|
|
run: bun test scripts/auto-close-duplicates.test.ts
|
|
|
|
sweep:
|
|
if: github.event_name != 'pull_request' && github.repository == 'BerriAI/litellm'
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
permissions:
|
|
contents: read
|
|
issues: write
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
|
|
with:
|
|
# Exact version, never latest: the next step holds an issues: write token
|
|
bun-version: "1.4.0"
|
|
|
|
- name: Close unanswered duplicates, reopen ones the reporter answered
|
|
run: bun run scripts/auto-close-duplicates.ts
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
DRY_RUN: ${{ inputs.dry_run == true }}
|
|
GRACE_PERIOD_DAYS: ${{ inputs.grace_period_days }}
|