mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-30 04:20:11 +01:00
cd1255fba1
Ping and (after a grace period) close the stale community PRs where changes were requested but not addressed. Ping and (after a grace period) close the community PRs with no self-review. ## Testing Ran the dry-run locally and verified every PR listed. Release Notes: - N/A
65 lines
2.0 KiB
YAML
65 lines
2.0 KiB
YAML
# Keep the community pull request queue actionable by closing some PRs:
|
|
# - unsigned PRs: retry the CLA check, close if it fails and the author hasn't engaged
|
|
# - PRs that remain in draft without new commits: ping, then close
|
|
# - PRs whose author didn't respond to changes requested by staff: ping, then close
|
|
# - PRs labeled "no self-review" that keep the README notice: ping, then close
|
|
|
|
name: Community PR Cleanup
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "30 8 * * *"
|
|
workflow_dispatch:
|
|
inputs:
|
|
dry-run:
|
|
description: "Print what would be done without actually posting comments or closing pull requests"
|
|
type: boolean
|
|
default: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: community-pr-cleanup
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
cleanup:
|
|
if: github.repository == 'zed-industries/zed'
|
|
runs-on: namespace-profile-2x4-ubuntu-2404
|
|
timeout-minutes: 15
|
|
|
|
steps:
|
|
- name: Generate app token
|
|
id: app-token
|
|
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
|
|
with:
|
|
app-id: ${{ secrets.ZED_COMMUNITY_BOT_APP_ID }}
|
|
private-key: ${{ secrets.ZED_COMMUNITY_BOT_PRIVATE_KEY }}
|
|
owner: zed-industries
|
|
repositories: zed
|
|
permission-issues: write
|
|
permission-members: read
|
|
permission-pull-requests: write
|
|
|
|
- name: Checkout repository
|
|
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
|
with:
|
|
sparse-checkout: |
|
|
script/github-pr-cleanup.py
|
|
script/github_helpers.py
|
|
sparse-checkout-cone-mode: false
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Install dependencies
|
|
run: pip install requests
|
|
|
|
- name: Clean up pull requests
|
|
env:
|
|
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
run: python script/github-pr-cleanup.py ${{ inputs.dry-run && '--dry-run' || '' }}
|