Skip to content

Commit 2d6a414

Browse files
authored
Warn and block staging release if not run in a release branch (#6325)
1 parent 0197076 commit 2d6a414

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/release-staging.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,19 @@ name: Staging Release
33
on: workflow_dispatch
44

55
jobs:
6+
warn:
7+
name: Warn If Wrong Branch
8+
runs-on: ubuntu-latest
9+
# Log a warning if run in a non-release branch.
10+
if: github.ref != 'refs/heads/release' && !endsWith(github.ref, '-releasebranch')
11+
steps:
12+
- name: Log warning
13+
run: echo "This workflow must be run in a release branch. It is being run in ${{ github.ref }}."
614
deploy:
715
name: Staging Release
816
runs-on: ubuntu-latest
17+
# Block this workflow if run in a non-release branch.
18+
if: github.ref == 'refs/heads/release' || endsWith(github.ref, '-releasebranch')
919
# Allow GITHUB_TOKEN to have write permissions
1020
permissions:
1121
contents: write

0 commit comments

Comments
 (0)