Skip to content

Delete removed branch from GitLab mirror #395

Delete removed branch from GitLab mirror

Delete removed branch from GitLab mirror #395

name: Delete removed branch from GitLab mirror
on:
delete:
branches-ignore:
- master
- 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"