From 59eb02a7fb553bbffc406c5f6a12362238a76643 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 6 Jun 2023 09:04:20 +0100 Subject: [PATCH 1/4] Remove unused input --- .github/workflows/release-master.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/release-master.yml b/.github/workflows/release-master.yml index 97f823c11e..200391b4e0 100644 --- a/.github/workflows/release-master.yml +++ b/.github/workflows/release-master.yml @@ -10,11 +10,6 @@ on: # Exclude all pre-releases - "!v*[0-9]+.[0-9]+.[0-9]+-*" workflow_dispatch: - inputs: - tags: - description: "Release tag" - required: true - type: boolean env: # Posthog token used by ui at build time From 1b54a028db7039ece2be97f11dacc70258f9a89f Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 6 Jun 2023 09:04:39 +0100 Subject: [PATCH 2/4] Check type instead of reference --- .github/workflows/release-master.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-master.yml b/.github/workflows/release-master.yml index 200391b4e0..7cc2d57802 100644 --- a/.github/workflows/release-master.yml +++ b/.github/workflows/release-master.yml @@ -28,12 +28,13 @@ jobs: token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} fetch-depth: 0 - - name: Fail if branch is not master - if: github.ref != 'refs/heads/master' + - name: Fail if tag is not master run: | - echo "Ref is not master, you must run this job from master." - // Change to "exit 1" when merged. Left to 0 to not fail all the pipelines and not to cause noise - exit 0 + if ! git merge-base --is-ancestor ${{ github.sha }} origin/develop; then + echo "Tag is not in master. This pipeline can only execute tags that are present on the master branch" + exit 1 + fi + - uses: actions/setup-node@v1 with: From e173cd2c5184af621f15b51de6209befc94e5ea0 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 6 Jun 2023 09:11:45 +0100 Subject: [PATCH 3/4] Fix pointer --- .github/workflows/release-master.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-master.yml b/.github/workflows/release-master.yml index 7cc2d57802..271cfdb45a 100644 --- a/.github/workflows/release-master.yml +++ b/.github/workflows/release-master.yml @@ -30,7 +30,7 @@ jobs: - name: Fail if tag is not master run: | - if ! git merge-base --is-ancestor ${{ github.sha }} origin/develop; then + if ! git merge-base --is-ancestor ${{ github.sha }} origin/master; then echo "Tag is not in master. This pipeline can only execute tags that are present on the master branch" exit 1 fi From 63017cf959fdf29f58a8268317de3f4a655199c9 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 6 Jun 2023 09:12:10 +0100 Subject: [PATCH 4/4] Remove manual trigger --- .github/workflows/release-master.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release-master.yml b/.github/workflows/release-master.yml index 271cfdb45a..7cf2f99d9f 100644 --- a/.github/workflows/release-master.yml +++ b/.github/workflows/release-master.yml @@ -9,7 +9,6 @@ on: - "v[0-9]+.[0-9]+.[0-9]+" # Exclude all pre-releases - "!v*[0-9]+.[0-9]+.[0-9]+-*" - workflow_dispatch: env: # Posthog token used by ui at build time