From 9a0225e3fbe74800b107141ab1ed02aea8255fa0 Mon Sep 17 00:00:00 2001 From: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com> Date: Fri, 21 Jun 2024 07:07:36 +0200 Subject: [PATCH] ci: branch protection ci workflows (#606) --- .github/workflows/devnet-branch-protection.yml | 14 ++++++++++++++ .github/workflows/main-branch-protection.yml | 14 ++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 .github/workflows/devnet-branch-protection.yml create mode 100644 .github/workflows/main-branch-protection.yml diff --git a/.github/workflows/devnet-branch-protection.yml b/.github/workflows/devnet-branch-protection.yml new file mode 100644 index 000000000..58dab786b --- /dev/null +++ b/.github/workflows/devnet-branch-protection.yml @@ -0,0 +1,14 @@ +name: "Devnet branch protection" + +on: + pull_request: + +jobs: + check_branch: + runs-on: ubuntu-latest + steps: + - name: Check branch + if: github.base_ref == 'devnet' && github.head_ref != 'develop' + run: | + echo "ERROR: You can only merge to devnet from develop." + exit 1 diff --git a/.github/workflows/main-branch-protection.yml b/.github/workflows/main-branch-protection.yml new file mode 100644 index 000000000..45c221680 --- /dev/null +++ b/.github/workflows/main-branch-protection.yml @@ -0,0 +1,14 @@ +name: "Main branch protection" + +on: + pull_request: + +jobs: + check_branch: + runs-on: ubuntu-latest + steps: + - name: Check branch + if: github.base_ref == 'main' && github.head_ref != 'devnet' + run: | + echo "ERROR: You can only merge to main from devnet." + exit 1