content(home): update summary #5
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: Delete Merged Branch | |
on: | |
pull_request: | |
types: | |
- closed | |
jobs: | |
delete_merged_branch: | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.merged == true && (github.event.pull_request.base.ref == 'main' || github.event.pull_request.base.ref == 'develop') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.pull_request.base.ref }} | |
token: ${{ secrets.REPO_ACCESS }} | |
- name: Configure Git user | |
run: | | |
git config --global user.name "0xferit" | |
git config --global user.email "[email protected]" | |
- name: Delete merged branch | |
run: | | |
MERGED_BRANCH=${{ github.event.pull_request.head.ref }} | |
if [ ! -z "$MERGED_BRANCH" ]; then | |
git push origin --delete "$MERGED_BRANCH" | |
fi |