Delete removed branch from GitLab mirror #257
Workflow file for this run
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 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" |