From 16d9a548cf810ecebe6b28704a0a4520be2c5351 Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Tue, 28 May 2024 16:27:25 -0400 Subject: [PATCH] Add action to delete branch from remote --- .github/workflows/gitlab-del-branch.yml | 18 ++++++++++++++++++ .github/workflows/gitlab-mirror.yml | 2 -- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/gitlab-del-branch.yml diff --git a/.github/workflows/gitlab-del-branch.yml b/.github/workflows/gitlab-del-branch.yml new file mode 100644 index 000000000..4e9199fa0 --- /dev/null +++ b/.github/workflows/gitlab-del-branch.yml @@ -0,0 +1,18 @@ +name: Delete branch from GitLab +on: + delete: + branches: '*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Delete branch + env: + GITLAB_USERNAME: "project_34868_bot" + GITLAB_PASSWORD: ${{ secrets.GITLAB_PASSWORD }} + GITLAB_HOSTNAME: "git.drupal.org" + GITLAB_PATH: "project/islandora" + run: | + git remote add gitlab "https://$GITLAB_USERNAME:$GITLAB_PASSWORD@$GITLAB_HOSTNAME/$GITLAB_PATH" + git push gitlab :${GITHUB_REF#refs/heads/} diff --git a/.github/workflows/gitlab-mirror.yml b/.github/workflows/gitlab-mirror.yml index edeebce28..66be28c15 100644 --- a/.github/workflows/gitlab-mirror.yml +++ b/.github/workflows/gitlab-mirror.yml @@ -4,8 +4,6 @@ on: push: branches: '*' tags: '*' - delete: - branches: '*' jobs: build: