Skip to content

Clean up mod branches #299

Clean up mod branches

Clean up mod branches #299

name: Clean up mod branches
on:
schedule:
- cron: '15 21 * * *' # 6:15(JST)
workflow_dispatch:
jobs:
cleanup:
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: write
steps:
- name: Dump GitHub context
id: github_context_step
run: echo '${{ toJSON(github) }}'
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Clean up mod branches
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for branch in $(git branch -a | grep "remotes/origin/mod-up-*" | cut -d '/' -f3)
do
echo $branch
git push --delete origin $branch
done