From 66db3993b5c53549a07170abb510bc6d69745cde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20G=C3=B3ralczyk?= <83976515+Manie-K@users.noreply.github.com> Date: Sat, 26 Jul 2025 11:27:10 +0200 Subject: [PATCH 1/2] Create main.yml Action to prevent PR into main from branches other than development --- .github/workflows/main.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..bc716b8 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,17 @@ +name: Enforce PR Source Branch + +on: + pull_request: + branches: + - main + +jobs: + check_branch: + runs-on: ubuntu-latest + steps: + - name: Fail if PR is not from dev + run: | + if [[ "${{ github.head_ref }}" != "development" ]]; then + echo "Pull requests to main must come from the dev branch." + exit 1 + fi From 5e19881608d298e5945e24f08b8de8ff145fbd05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20G=C3=B3ralczyk?= <83976515+Manie-K@users.noreply.github.com> Date: Sat, 26 Jul 2025 11:28:01 +0200 Subject: [PATCH 2/2] Update main.yml Fixed branch name --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bc716b8..be1185b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: Enforce PR Source Branch on: pull_request: branches: - - main + - master jobs: check_branch: