pytorch/.github/workflows/delete_old_branches.yml
Catherine Lee d99b115eb3 Fix delete old branches workflow (#127442)
The ubuntu runner started using 2.45.1 (prev 2.43.2), which includes 1f49f7506f (changes +00:00 timezone to Z)

Python versions prior to 3.11 do not support Z when parsing isoformat, so update the workflow to use 3.11

Pull Request resolved: https://github.com/pytorch/pytorch/pull/127442
Approved by: https://github.com/huydhn, https://github.com/malfet
2024-05-29 21:17:09 +00:00

39 lines
797 B
YAML

# A workflow that deletes branches of closed PRs
name: Delete old branches
on:
schedule:
# Run daily.
- cron: 30 1 * * *
workflow_dispatch:
concurrency:
group: delete-old-branches
cancel-in-progress: true
permissions:
contents: write
jobs:
delete:
if: ${{ github.repository == 'pytorch/pytorch' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
architecture: x64
check-latest: false
- name: Delete old branches
run: python .github/scripts/delete_old_branches.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}