Added branch protection rules #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |