mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-24 00:52:24 +00:00
* feat(ci): close open pull requests superseded by a merged fix on their linked issue * fix(ci): replace the mixed-anchor release-line regex with a plain predicate * fix(ci): recover a half-done close, page linked pull requests, trust only the workflow's marker * fix(ci): close superseded pull requests whatever closed the issue and fail the job when the script throws --------- Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
79 lines
2.8 KiB
YAML
79 lines
2.8 KiB
YAML
name: Issue fixed comment
|
|
|
|
on:
|
|
issues:
|
|
types: [closed]
|
|
workflow_dispatch:
|
|
inputs:
|
|
issue_number:
|
|
description: "Closed issue number to comment on and close the superseded pull requests of. Ignored by a sweep."
|
|
required: false
|
|
sweep:
|
|
description: "Close every open pull request whose linked issues were all fixed on the default branch. Reads every open pull request, so run it at most once an hour."
|
|
type: boolean
|
|
default: false
|
|
pull_request:
|
|
paths:
|
|
- .github/workflows/issue_fixed_comment.yml
|
|
- scripts/comment-fixed-issue.ts
|
|
- scripts/comment-fixed-issue.test.ts
|
|
- scripts/auto-close-duplicates.ts
|
|
|
|
permissions: {}
|
|
|
|
concurrency:
|
|
group: issue-fixed-comment-${{ github.event.issue.number || github.event.inputs.issue_number || github.run_id }}
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
comment-fixed-issue-tests:
|
|
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 closer lookup, the release placement, the comment and the superseded pull request close
|
|
run: bun test scripts/comment-fixed-issue.test.ts
|
|
|
|
comment-fixed-issue:
|
|
if: github.event_name != 'pull_request' && github.repository == 'BerriAI/litellm'
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
permissions:
|
|
contents: read
|
|
issues: write
|
|
pull-requests: write
|
|
steps:
|
|
- name: Checkout scripts
|
|
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
|
with:
|
|
sparse-checkout: scripts
|
|
persist-credentials: false
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
|
|
with:
|
|
# Exact version, never latest: the next step holds issues: write and pull-requests: write tokens
|
|
bun-version: "1.4.0"
|
|
|
|
- name: Name the release that carries the fix and close the pull requests it supersedes
|
|
shell: bash
|
|
run: bun run scripts/comment-fixed-issue.ts | tee -a "${GITHUB_STEP_SUMMARY}"
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
ISSUE_NUMBER: ${{ github.event.issue.number || github.event.inputs.issue_number }}
|
|
SWEEP: ${{ github.event.inputs.sweep }}
|
|
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
|
|
DRY_RUN: ${{ vars.ISSUE_FIXED_COMMENT_ENABLED != 'true' }}
|
|
CLOSE_PRS_DRY_RUN: ${{ vars.ISSUE_FIXED_CLOSE_PRS_ENABLED != 'true' }}
|