Skip to content
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
29 changes: 29 additions & 0 deletions .github/workflows/flow-guard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Flow Guard
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
flow-guard:
runs-on: ubuntu-latest
steps:
- name: Validate promotion path
run: |
BASE="${{ github.event.pull_request.base.ref }}"
HEAD="${{ github.event.pull_request.head.ref }}"
echo "Base: $BASE Head: $HEAD"

if [ "$BASE" = "staging" ]; then
if [ "$HEAD" != "dev" ]; then
echo "ERROR: staging can only receive PRs from dev."
exit 1
fi
fi

if [ "$BASE" = "master" ]; then
if [ "$HEAD" != "staging" ]; then
echo "ERROR: master can only receive PRs from staging."
exit 1
fi
fi

echo "Flow guard passed."
Loading