Skip to content

Warn and block staging release if not run in a release branch #6325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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