Merge pull request #2 from EnderModuBot/bug/1-setup-failed-delete-thi… #2
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: Initial Repository Setup | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| paths: | |
| - '.github/workflows/setup.yml' | |
| jobs: | |
| minimal-setup: | |
| if: github.repository != 'EnderModuBot/template' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Enable branch auto-deletion via API | |
| run: | | |
| curl -s -X PATCH "https://api.github.com/repos/${{ github.repository }}" \ | |
| -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -d '{"delete_branch_on_merge":true}' | jq | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Delete this workflow file | |
| run: | | |
| git config --global user.name "setup-bot" | |
| git config --global user.email "setup@github.com" | |
| git rm .github/workflows/setup.yml | |
| git commit -m "chore: remove setup workflow" | |
| git push |