From b38fb3bee074af7a0ec01af01b65846385f117e7 Mon Sep 17 00:00:00 2001 From: Vince Grassia <593223+vgrassia@users.noreply.github.com> Date: Fri, 5 Nov 2021 10:20:43 -0400 Subject: [PATCH] Fix release workflow to allow releases from 'rc' or 'hotfix' branches only (#2158) --- .github/workflows/release.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cc346d5310..1ebe9fa07c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,20 +12,19 @@ jobs: runs-on: ubuntu-20.04 outputs: release-version: ${{ steps.version.outputs.package-version }} + branch-name: ${{ steps.branch.outputs.branch-name }} steps: - name: Branch check run: | - if [[ "$GITHUB_REF" != "refs/heads/release" ]]; then + if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ "$GITHUB_REF" != "refs/heads/hotfix" ]]; then echo "===================================" - echo "[!] Can only release from the 'release' branch" + echo "[!] Can only release from the 'rc' or 'hotfix' branches" echo "===================================" exit 1 fi - name: Checkout repo uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f - with: - ref: release - name: Check Release Version id: version @@ -42,6 +41,12 @@ jobs: echo "::set-output name=package-version::$version" + - name: Get branch name + id: branch + run: | + BRANCH_NAME=$(basename ${{ github.ref }}) + echo "::set-output name=branch-name::$BRANCH_NAME" + locales-test: name: Locales Test @@ -88,7 +93,7 @@ jobs: with: workflow: build.yml workflow_conclusion: success - branch: release + branch: ${{ needs.setup.outputs.branch-name }} artifacts: 'browser-source-*.zip, dist-chrome-*.zip, dist-opera-*.zip,