From 4eaef4814596d3eb5a0b6ac7dafd953a746bc4bb Mon Sep 17 00:00:00 2001 From: Guy Garcia Date: Wed, 25 Jun 2025 22:03:28 -0400 Subject: [PATCH] added branch protection rules --- .github/workflows/branch_protection.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/branch_protection.yml diff --git a/.github/workflows/branch_protection.yml b/.github/workflows/branch_protection.yml new file mode 100644 index 0000000..5c9c030 --- /dev/null +++ b/.github/workflows/branch_protection.yml @@ -0,0 +1,21 @@ +name: branch_protection.yml +on: + pull_request: + +jobs: + protect_testnet: + runs-on: ubuntu-latest + steps: + - name: Protect branch + if: github.base_ref == 'testnet' && github.head_ref != 'main' + run: | + echo "ERROR: You can only merge to testnet from main." + exit 1 + protect_mainnet: + runs-on: ubuntu-latest + steps: + - name: Protect branch + if: github.base_ref == 'mainnet' && github.head_ref != 'testnet' + run: | + echo "ERROR: You can only merge to mainnet from testnet." + exit 1 \ No newline at end of file