setup vrt #1
Workflow file for this run
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: clean-vrt-report-branch | |
on: | |
pull_request: | |
types: [closed] | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
delete-dir: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: gh-pages | |
fetch-depth: 0 | |
- name: delete closed pr branch directory | |
run: | | |
if [[ "${{ github.head_ref }}" != "" ]]; then | |
rm -rf "./${{ github.head_ref }}" | |
fi | |
- name: check if there were changes | |
id: git_diff | |
run: | | |
git diff --exit-code || echo "changed=true" >> $GITHUB_OUTPUT | |
- name: Commit and push | |
if: steps.git_diff.outputs.changed == 'true' | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add -A | |
git commit -m "delete ${{ github.head_ref }} directory" | |
git push |