From ada4e53b466fe24fa33c1261efa1613ec4e45ae4 Mon Sep 17 00:00:00 2001 From: daniel31x13 Date: Thu, 14 Nov 2024 02:42:01 -0500 Subject: [PATCH] created check-branch.yml --- .github/workflows/check-branch.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/check-branch.yml diff --git a/.github/workflows/check-branch.yml b/.github/workflows/check-branch.yml new file mode 100644 index 0000000..68232f2 --- /dev/null +++ b/.github/workflows/check-branch.yml @@ -0,0 +1,18 @@ +name: Check pull request source branch +on: + pull_request_target: + types: + - opened + - reopened + - synchronize + - edited +jobs: + check-branches: + runs-on: ubuntu-latest + steps: + - name: Check branches + run: | + if [ ${{ github.head_ref }} != "dev" ] && [ ${{ github.base_ref }} == "main" ]; then + echo "Merge requests to main branch are only allowed from dev branch. Please rebase your changes to dev branch." + exit 1 + fi