Remove deleted branch from launchermeta #544
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: Remove deleted branch from launchermeta | |
on: | |
delete: | |
jobs: | |
remove_deleted_branch: | |
runs-on: ubuntu-latest | |
name: Remove deleted branch | |
if: github.event.ref_type == 'branch' | |
steps: | |
- name: Setup ssh agent | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Delete branch from launchermeta | |
run: | | |
# init git configuration | |
git config --global user.name "CloudNetAutomation"; | |
git config --global user.email "[email protected]"; | |
# clone the repo from the remote, without objects (partial clone) | |
git clone --filter=blob:none --no-checkout [email protected]:CloudNetService/launchermeta.git del_temp; | |
# navigate into the cloned repo and remove the delete branch (while ignoring all errors) | |
cd del_temp; | |
git push origin --delete "${{ github.event.ref }}" || true; |