From f29aaa217062c8d474fcd7ccacbc00b1f2f70d6b Mon Sep 17 00:00:00 2001 From: Moritz Utcke Date: Sat, 2 Aug 2025 13:57:34 -0400 Subject: [PATCH] Prevent Wrong PR Fix --- .github/workflows/prevent-wrong-pr.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/prevent-wrong-pr.yml b/.github/workflows/prevent-wrong-pr.yml index d25826c0..07f78b22 100644 --- a/.github/workflows/prevent-wrong-pr.yml +++ b/.github/workflows/prevent-wrong-pr.yml @@ -13,18 +13,15 @@ jobs: steps: - name: Prevent dev merges run: | - echo "${{ github.head_ref }}"; - echo "${{ github.base_ref }}"; - if [[ "${{ github.head_ref }}" == "dev" ]]; then - echo "ERROR: Merging 'dev' into '${{ github.base_ref }}' is forbidden!" + if [[ "${{ github.head_ref }}" == "dev" && "${{ github.base_ref }}" == "main" ]]; then + echo "ERROR: Merging 'dev' into 'main' is forbidden!" exit 1 fi + - name: Allow only staging into main if: github.base_ref == 'main' run: | - echo "${{ github.head_ref }}"; - echo "${{ github.base_ref }}"; if [[ "${{ github.head_ref }}" != "staging" ]]; then echo "ERROR: Only 'staging' branch is allowed to merge into 'main'. Current: '${{ github.head_ref }}'" exit 1