From 1845fc0a52ed602b457598117dd1991f575e6aa5 Mon Sep 17 00:00:00 2001 From: Rosie Le Faive Date: Tue, 28 May 2024 11:30:13 -0300 Subject: [PATCH 1/4] Sync all branches on push and delete. --- .github/workflows/gitlab-mirror.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gitlab-mirror.yml b/.github/workflows/gitlab-mirror.yml index f59207e8a..75c6a9cdd 100644 --- a/.github/workflows/gitlab-mirror.yml +++ b/.github/workflows/gitlab-mirror.yml @@ -2,8 +2,10 @@ name: Mirror and run GitLab CI on: push: - branches: [2.x] + branches: '*' tags: '*' + delete: + branches: '*' jobs: build: From b33d13d2a533b79c73e9ccd12c51fb7ef9dce879 Mon Sep 17 00:00:00 2001 From: Rosie Le Faive Date: Tue, 28 May 2024 11:32:41 -0300 Subject: [PATCH 2/4] Use checkoutv4. --- .github/workflows/gitlab-mirror.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gitlab-mirror.yml b/.github/workflows/gitlab-mirror.yml index 75c6a9cdd..edeebce28 100644 --- a/.github/workflows/gitlab-mirror.yml +++ b/.github/workflows/gitlab-mirror.yml @@ -11,7 +11,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Mirror + trigger CI From 16d9a548cf810ecebe6b28704a0a4520be2c5351 Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Tue, 28 May 2024 16:27:25 -0400 Subject: [PATCH 3/4] 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: From a6fbc55bdf0ed99e87cadd826336f604a9a371aa Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Tue, 28 May 2024 16:30:15 -0400 Subject: [PATCH 4/4] Update gitlab-del-branch.yml --- .github/workflows/gitlab-del-branch.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gitlab-del-branch.yml b/.github/workflows/gitlab-del-branch.yml index 4e9199fa0..0d3d0bdda 100644 --- a/.github/workflows/gitlab-del-branch.yml +++ b/.github/workflows/gitlab-del-branch.yml @@ -7,6 +7,7 @@ jobs: build: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 - name: Delete branch env: GITLAB_USERNAME: "project_34868_bot"