Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/community_pr_cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Warn and close pull requests that remain in draft without new commits, and
# close unsigned community pull requests that have not engaged about CLA trouble.

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-pull-requests: write

- name: Checkout repository
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
sparse-checkout: |
script/github-pr-cleanup.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' || '' }}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- "Comment on potential duplicate bug/crash reports"
- "Track duplicate bot effectiveness"
- "Community PR Board"
- "Community PR Cleanup"
- "PR Board Meta Fields Refresh"
- "PR Issue Labeler"
- "Guild Assignment Status"
Expand Down
Loading
Loading