Branch Deleted #276
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: Branch Deleted | |
on: delete | |
jobs: | |
delete: | |
name: On branch deleted | |
if: github.event.ref_type == 'branch' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set env | |
run: | | |
GIT_BRANCH=$(echo ${{ github.event.ref }} | sed -e "s#refs/heads/##g") | |
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV | |
echo "branch deleted is $GIT_BRANCH" | |
- name: Clean up | |
run: | | |
echo "Clean up for branch ${{ env.GIT_BRANCH }}" | |
- name: Get current published documentation | |
uses: actions/checkout@v3 | |
with: | |
ref: gh-pages | |
- name: Remove branches draft docs | |
run: | | |
rm -rf ${{ env.GIT_BRANCH }} | |
- name: Save updated docs | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Removed Draft Docs for ${{ env.GIT_BRANCH }} |