1# A workflow that deletes branches of closed PRs 2 3name: Delete old branches 4 5on: 6 schedule: 7 # Run daily. 8 - cron: 30 1 * * * 9 workflow_dispatch: 10 11concurrency: 12 group: delete-old-branches 13 cancel-in-progress: true 14 15permissions: 16 contents: write 17 18jobs: 19 delete: 20 if: ${{ github.repository == 'pytorch/pytorch' }} 21 runs-on: ubuntu-latest 22 23 steps: 24 - name: Checkout repo 25 uses: actions/checkout@v3 26 with: 27 fetch-depth: 0 28 29 - name: Setup Python 30 uses: actions/setup-python@v4 31 with: 32 python-version: '3.11' 33 architecture: x64 34 check-latest: false 35 36 - name: Delete old branches 37 run: python .github/scripts/delete_old_branches.py 38 env: 39 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 40