From 5dbc96172ca3b9244ce59b6c1ccaf575c982b534 Mon Sep 17 00:00:00 2001 From: Francisco Casiano Date: Sat, 5 Jul 2025 15:49:56 -0400 Subject: [PATCH 1/2] Removed unnecessary label and emoji --- .github/workflows/merge_protection.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/merge_protection.yml b/.github/workflows/merge_protection.yml index 35b8ba9..8600b73 100644 --- a/.github/workflows/merge_protection.yml +++ b/.github/workflows/merge_protection.yml @@ -106,7 +106,7 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, issue_number: context.issue.number, - labels: ['branch-protection-violation', 'needs-attention'] + labels: ['branch-protection-violation'] }); - name: Optional - Auto-close PR @@ -125,5 +125,5 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, issue_number: context.issue.number, - body: '🔒 This PR has been automatically closed due to branch protection rules. Please follow the correct workflow and create a new PR.' + body: 'This PR has been automatically closed due to branch protection rules. Please follow the correct workflow and create a new PR.' }); From a3f1649bbdb4357daa7f98929ef09a279482f08b Mon Sep 17 00:00:00 2001 From: Francisco Casiano Date: Sat, 5 Jul 2025 15:53:59 -0400 Subject: [PATCH 2/2] Added protection for the main branch --- .github/workflows/merge_protection.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/merge_protection.yml b/.github/workflows/merge_protection.yml index 8600b73..6998d3c 100644 --- a/.github/workflows/merge_protection.yml +++ b/.github/workflows/merge_protection.yml @@ -19,6 +19,25 @@ jobs: echo "Base branch: ${{ github.base_ref }}" echo "Head branch: ${{ github.head_ref }}" + # Check testnet protection + if [[ "${{ github.base_ref }}" == "main" && "${{ github.head_ref }}" != "dev" ]]; then + echo "violation=testnet" >> $GITHUB_OUTPUT + { + echo 'message<> $GITHUB_OUTPUT + exit 1 + fi + # Check testnet protection if [[ "${{ github.base_ref }}" == "testnet" && "${{ github.head_ref }}" != "main" ]]; then echo "violation=testnet" >> $GITHUB_OUTPUT