mirror of
https://github.com/bartvdbraak/omnidash.git
synced 2025-04-28 07:51:20 +00:00
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.3 to 3.6.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3.5.3...v3.6.0) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
34 lines
996 B
YAML
34 lines
996 B
YAML
name: Cleanup GitHub Pages on Branch Deletion
|
|
|
|
on:
|
|
delete
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
concurrency:
|
|
group: "pages"
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
cleanup:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3.6.0
|
|
|
|
- name: Delete directory in gh-pages
|
|
if: github.event.ref_type == 'branch'
|
|
run: |
|
|
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
git config --global user.name "github-actions[bot]"
|
|
git fetch --all
|
|
git checkout gh-pages
|
|
branchName=$(echo "${{ github.event.ref }}" | sed -e 's,^refs/heads/,,')
|
|
if [ -d "./${branchName}" ]; then
|
|
git rm -rf --ignore-unmatch "${branchName}"
|
|
git commit -m "Cleanup directory for deleted branch ${branchName}"
|
|
git push origin gh-pages
|
|
else
|
|
echo "Directory doesn't exist for branch ${branchName}"
|
|
fi
|