Skip to content

branch-cleanup

branch-cleanup #227

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="koinos-proto-$lang"
REPO_URL="https://koinos-ci:[email protected]/koinos/$REPO.git"
git clone $REPO_URL
pushd $REPO
REMOTE_REF=$(git ls-remote $REPO_URL --heads ${{ github.event.ref }})
if [[ $REMOTE_REF ]]; then
git push $REPO_URL --delete ${{ github.event.ref }}
fi
popd
done