Browse Source

Change release workflow to only allow releases from rc or hotfix branches (#1279)

PS-589-add-2fa-new-device-login-settings-flag
Vince Grassia 4 years ago committed by GitHub
parent
commit
fe15de02e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      .github/workflows/release.yml

15
.github/workflows/release.yml

@ -12,12 +12,13 @@ jobs: @@ -12,12 +12,13 @@ jobs:
outputs:
release_version: ${{ steps.version.outputs.package }}
tag_version: ${{ steps.version.outputs.tag }}
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
@ -41,6 +42,12 @@ jobs: @@ -41,6 +42,12 @@ jobs:
echo "::set-output name=package::$version"
echo "::set-output name=tag::v$version"
- name: Get branch name
id: branch
run: |
BRANCH_NAME=$(basename ${{ github.ref }})
echo "::set-output name=branch-name::$BRANCH_NAME"
self-host:
name: Release self-host docker
@ -124,7 +131,7 @@ jobs: @@ -124,7 +131,7 @@ jobs:
with:
workflow: build.yml
workflow_conclusion: success
branch: release
branch: ${{ needs.setup.outputs.branch-name }}
artifacts: web-*-cloud-COMMERCIAL.zip
# This should result in a build directory in the current working directory
@ -165,7 +172,7 @@ jobs: @@ -165,7 +172,7 @@ jobs:
with:
workflow: build.yml
workflow_conclusion: success
branch: release
branch: ${{ needs.setup.outputs.branch-name }}
artifacts: "web-*-selfhosted-COMMERCIAL.zip,
web-*-selfhosted-open-source.zip"

Loading…
Cancel
Save