Delete Obsolete Coverage Report #1582
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 Obsolete Coverage Report | |
on: | |
delete: | |
branches: | |
- '**' | |
- '!gh-pages' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: "startsWith(github.event.ref_type, 'branch')" | |
steps: | |
- name: Clone report repo | |
run: | | |
git clone https://github.com/Gwion/gwion-coverage-report | |
cd gwion-coverage-report | |
branch=${{ github.event.ref }} | |
if [ -d html/$branch ] | |
then | |
rm -r html/$branch | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git remote set-url origin https://${{ secrets.COVERAGE_TOKEN }}@github.com/Gwion/gwion-coverage-report.git | |
git add html | |
git commit -m "Delete obsolete branch" | |
git subtree push --prefix html origin gh-pages | |
fi |