Skip to content

branch-cleanup

branch-cleanup #214

name: branch-cleanup
on: [delete]
jobs:
branch_cleanup:
if: github.event.ref_type == 'branch'
runs-on: ubuntu-latest
env:
BRANCH_CLEANUP_TOKEN: ${{ secrets.BRANCH_CLEANUP_TOKEN }}
steps:
- run: |
for lang in cpp golang js python embedded-cpp descriptors as
do
REPO_URL="https://koinos-ci:[email protected]/koinos/koinos-proto-$lang.git"
REMOTE_REF=$(git ls-remote --heads $REPO_URL ${{ github.event.ref }})
if [[ $REMOTE_REF ]]; then
git push $REPO_URL :${{ github.event.ref }}
fi
done