Clean up mod branches #256
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |