From 1b54a028db7039ece2be97f11dacc70258f9a89f Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 6 Jun 2023 09:04:39 +0100 Subject: [PATCH] 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: