branch-cleanup #209
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: branch-cleanup | |
on: [delete] | |
jobs: | |
branch_cleanup: | |
if: github.event.ref_type == 'branch' | |
runs-on: ubuntu-latest | |
env: | |
KOINOS_CI_TOKEN: ${{ secrets.KOINOS_CI_TOKEN }} | |
steps: | |
- run: | | |
for lang in cpp golang js python embedded-cpp descriptors as documentation | |
do | |
repo=koinos-proto-$lang | |
git clone https://[email protected]/koinos/`echo $repo`.git | |
pushd $repo | |
exists_in_remote=$(git ls-remote --heads origin ${{ github.event.ref }}) | |
if [[ ${exists_in_remote} ]]; then | |
git push https://[email protected]/koinos/`echo $repo`.git --delete ${{ github.event.ref }} | |
fi | |
popd | |
done | |
git clone https//[email protected]/koinos/koinos-openapi.git | |
pushd koinos-openapi | |
exists_in_remote=$(git ls-remote --heads origin ${{ github.event.ref }}) | |
if [[ ${exists_in_remote} ]]; then | |
git push https://[email protected]/koinos/koinos-openapi.git --delete ${{ github.event.ref }} | |
fi | |
popd |