Skip to content

Delete removed GitHub branch from GitLab remote #14

Delete removed GitHub branch from GitLab remote

Delete removed GitHub branch from GitLab remote #14

name: Delete removed GitHub branch from GitLab remote
on:
delete:
branches-ignore:
- main
- dev
jobs:
branch-delete:
if: github.event.ref_type == 'branch'
runs-on: ubuntu-latest
env:
TOKEN: ${{ secrets.GITLAB_TOKEN }}
REPO: ensembl-web%2F${{ github.event.repository.name }}
BRANCH: ${{ github.event.ref }}
steps:
- name: Send branch delete request
run: |
BRANCH=${BRANCH//\//%2F}
curl --request DELETE --header "PRIVATE-TOKEN: $TOKEN" "https://gitlab.ebi.ac.uk/api/v4/projects/$REPO/repository/branches/$BRANCH"