Skip to content

Commit e6996a7

Browse files
authored
feat: Add flow guard CI for promotion paths (#497)
1 parent e317337 commit e6996a7

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/flow-guard.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Flow Guard
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
jobs:
6+
flow-guard:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Validate promotion path
10+
run: |
11+
BASE="${{ github.event.pull_request.base.ref }}"
12+
HEAD="${{ github.event.pull_request.head.ref }}"
13+
echo "Base: $BASE Head: $HEAD"
14+
15+
if [ "$BASE" = "staging" ]; then
16+
if [ "$HEAD" != "dev" ]; then
17+
echo "ERROR: staging can only receive PRs from dev."
18+
exit 1
19+
fi
20+
fi
21+
22+
if [ "$BASE" = "master" ]; then
23+
if [ "$HEAD" != "staging" ]; then
24+
echo "ERROR: master can only receive PRs from staging."
25+
exit 1
26+
fi
27+
fi
28+
29+
echo "Flow guard passed."

0 commit comments

Comments
 (0)