Bump external-dns to latest stable version #3
Workflow file for this run
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: Delete Merged Branches | |
| on: | |
| pull_request: | |
| types: | |
| - closed | |
| jobs: | |
| delete-branch: | |
| # Only run if the PR was merged (not just closed) | |
| if: github.event.pull_request.merged == true | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Delete merged branch | |
| run: | | |
| BRANCH_NAME="${{ github.event.pull_request.head.ref }}" | |
| # Don't delete main/master or other protected branches | |
| if [[ "$BRANCH_NAME" == "main" || "$BRANCH_NAME" == "master" || "$BRANCH_NAME" == "develop" ]]; then | |
| echo "Skipping deletion of protected branch: $BRANCH_NAME" | |
| exit 0 | |
| fi | |
| echo "Deleting merged branch: $BRANCH_NAME" | |
| gh api \ | |
| --method DELETE \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| "/repos/${{ github.repository }}/git/refs/heads/$BRANCH_NAME" | |
| echo "Successfully deleted branch: $BRANCH_NAME" | |
| env: | |
| GH_TOKEN: ${{ github.token }} |