Delete removed GitHub branch from GitLab remote #33
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: 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" |