From 6b893ce71fd6163189c6cd5ceffaffdc0cbf84d0 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Mon, 24 Apr 2023 17:16:23 -0400 Subject: [PATCH] ci: add release branch check to build workflow --- .github/workflows/build.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9a93a25a0..5c05852c6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,10 +2,6 @@ name: Build and Release run-name: ${{ github.event.inputs.publish == 'true' && '[Prod]' || '[Dev]' }} Build ${{ github.run_number }} of branch ${{ github.ref_name }} by @${{ github.actor }} on: - push: - tags: - - '*' - workflow_dispatch: inputs: summary: @@ -58,6 +54,13 @@ jobs: to_tag: ${{ steps.semver.outputs.current }} steps: + - name: Ensure Release Branch + if: ${{ github.event.inputs.publish == 'true' && github.ref_name != 'release' }} + uses: actions/github-script@v3 + with: + script: | + core.setFailed('Production release must be done from release branch!') + - uses: actions/checkout@v3 with: fetch-depth: 0