From ec259af317314ee092ca572b729ab30de924315a Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Tue, 1 Jul 2025 11:55:19 +0300 Subject: [PATCH] Add or update prevent-invalid-branch-merges workflow --- .../workflows/prevent-invalid-branch-merges.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/prevent-invalid-branch-merges.yml b/.github/workflows/prevent-invalid-branch-merges.yml index 2a72edee6..24bb05fbb 100644 --- a/.github/workflows/prevent-invalid-branch-merges.yml +++ b/.github/workflows/prevent-invalid-branch-merges.yml @@ -24,6 +24,7 @@ on: - dev_openeducat_erp-14.0.1.0 - dev_odex25_ensan - dev_odex25_helpdesk + - dev_odex25_donation - preprod_odex-event - preprod_odex25_accounting @@ -45,6 +46,7 @@ on: - preprod_openeducat_erp-14.0.1.0 - preprod_odex25_ensan - preprod_odex25_helpdesk + - preprod_odex25_donation - master_odex-event - master_odex25_accounting @@ -66,7 +68,7 @@ on: - master_openeducat_erp-14.0.1.0 - master_odex25_ensan - master_odex25_helpdesk - + - master_odex25_donation @@ -181,6 +183,11 @@ jobs: exit 1 fi + if [[ "${{ github.base_ref }}" == "preprod_odex25_donation" && "${{ github.head_ref }}" != "dev_odex25_donation" ]]; then + echo "::error ::You can only merge to 'preprod_odex25_donation' from 'dev_odex25_donation' branch!" + exit 1 + fi + # ✅ Master Branches if [[ "${{ github.base_ref }}" == "master_odex-event" && "${{ github.head_ref }}" != "preprod_odex-event" ]]; then echo "::error ::You can only merge to 'master_odex-event' from 'preprod_odex-event' branch!" @@ -282,6 +289,11 @@ jobs: exit 1 fi + if [[ "${{ github.base_ref }}" == "master_odex25_donation" && "${{ github.head_ref }}" != "preprod_odex25_donation" ]]; then + echo "::error ::You can only merge to 'master_odex25_donation' from 'preprod_odex25_donation' branch!" + exit 1 + fi + # ❌ Block ALL merges to 'master' if [[ "${{ github.base_ref }}" == "master" ]]; then