From 76ef697c7dca6a828c7498996ff3313859c872f2 Mon Sep 17 00:00:00 2001 From: AlvaroCubi <55387701+AlvaroCubi@users.noreply.github.com> Date: Fri, 26 Apr 2024 13:36:44 +0200 Subject: [PATCH] Add a github workflow that prevents PRs to main that is not comming from dev (#92) (#93) --- .github/workflows/enforce_main_pr_from_dev.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/enforce_main_pr_from_dev.yml diff --git a/.github/workflows/enforce_main_pr_from_dev.yml b/.github/workflows/enforce_main_pr_from_dev.yml new file mode 100644 index 00000000..e5639efb --- /dev/null +++ b/.github/workflows/enforce_main_pr_from_dev.yml @@ -0,0 +1,14 @@ +name: 'Check that PR to main is coming from dev if necessary' + +on: + pull_request: + +jobs: + check_branch: + runs-on: ubuntu-latest + steps: + - name: Check branch + if: github.base_ref == 'main' && github.head_ref != 'dev' + run: | + echo "ERROR: You can only merge to main from dev." + exit 1