You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/merge_protection.yml
+21-2Lines changed: 21 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,25 @@ jobs:
19
19
echo "Base branch: ${{ github.base_ref }}"
20
20
echo "Head branch: ${{ github.head_ref }}"
21
21
22
+
# Check main protection
23
+
if [[ "${{ github.base_ref }}" == "main" && "${{ github.head_ref }}" != "dev" ]]; then
24
+
echo "violation=testnet" >> $GITHUB_OUTPUT
25
+
{
26
+
echo 'message<<EOF'
27
+
echo "❌ **Branch Protection Violation**"
28
+
echo ""
29
+
echo "You are trying to merge from \`${{ github.head_ref }}\` to \`main\`, but our branch protection rules only allow merges from \`dev\` to \`main\`."
30
+
echo ""
31
+
echo "**Correct workflow:**"
32
+
echo "1. Merge your changes to \`dev\` first"
33
+
echo "2. Then create a PR from \`dev\` to \`main\`"
34
+
echo ""
35
+
echo "This ensures proper code flow and testing procedures."
36
+
echo 'EOF'
37
+
} >> $GITHUB_OUTPUT
38
+
exit 1
39
+
fi
40
+
22
41
# Check testnet protection
23
42
if [[ "${{ github.base_ref }}" == "testnet" && "${{ github.head_ref }}" != "main" ]]; then
0 commit comments