Fix release workflow to allow releases from 'rc' or 'hotfix' branches only (#2158)

This commit is contained in:
Vince Grassia 2021-11-05 10:20:43 -04:00 committed by GitHub
parent d4231589ad
commit b38fb3bee0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 5 deletions

View File

@ -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,