Clean up mod branches #779
This file contains hidden or 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: '16 21 * * *' # 6:16(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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| 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 |