Skip to content

Delete build folder on branch deletion #1068

Delete build folder on branch deletion

Delete build folder on branch deletion #1068

name: Delete build folder on branch deletion
permissions: read-all
on: delete
jobs:
delete-folder:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
if: github.event.ref_type == 'branch'
env:
FULL_BRANCH_NAME: ${{ github.event.ref }}
steps:
- name: Extract branch name
run: echo "branch=${FULL_BRANCH_NAME#refs/heads/}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
with:
repository: mi6/ic-ui-kit
ref: gh-pages
- name: Remove and commit
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 #v9.1.4
if: steps.extract_branch.outputs.branch != ''
with:
add: ""
remove: ./branches/${{ steps.extract_branch.outputs.branch }} -r
message: |
Branch: ${{ steps.extract_branch.outputs.branch }} deleted in ic-ui-kit