Skip to content

Commit

Permalink
Warn and block staging release if not run in a release branch (#6325)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsubox76 committed Jun 3, 2022
1 parent 0197076 commit 2d6a414
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/release-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@ name: Staging Release
on: workflow_dispatch

jobs:
warn:
name: Warn If Wrong Branch
runs-on: ubuntu-latest
# Log a warning if run in a non-release branch.
if: github.ref != 'refs/heads/release' && !endsWith(github.ref, '-releasebranch')
steps:
- name: Log warning
run: echo "This workflow must be run in a release branch. It is being run in ${{ github.ref }}."
deploy:
name: Staging Release
runs-on: ubuntu-latest
# Block this workflow if run in a non-release branch.
if: github.ref == 'refs/heads/release' || endsWith(github.ref, '-releasebranch')
# Allow GITHUB_TOKEN to have write permissions
permissions:
contents: write
Expand Down

0 comments on commit 2d6a414

Please sign in to comment.