Skip to content

Prune Branches

Prune Branches #7

name: Prune Branches
on:
workflow_dispatch:
inputs:
days:
description: 'Branches older than this amount of days will be deleted'
required: true
default: '90'
type: string
maximum:
description: 'Maximum limit of branches to delete for a single run'
required: true
default: '500'
type: string
push:
paths:
- '.github/workflows/prune_branches.yml'
schedule:
- cron: '0 */12 * * *'
jobs:
remove:
name: Remove Old Branches
runs-on: ubuntu-latest
steps:
- name: Checkout Arrow
shell: bash
run: git clone https://github.com/apache/arrow
- name: Checkout Crossbow
shell: bash
run: git clone https://github.com/ursacomputing/crossbow
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install Archery
shell: bash
run: pip install -e arrow/dev/archery[crossbow]
- name: Delete Branches
shell: bash
env:
CROSSBOW_GITHUB_TOKEN: ${{ secrets.CROSSBOW_GITHUB_TOKEN }}
run: archery crossbow delete-old-branches --days ${{ github.event.inputs.days || '90'}} --maximum ${{ github.event.inputs.maximum || '500'}}