diff --git a/.github/workflows/merge_protection.yml b/.github/workflows/merge_protection.yml index 35b8ba9..f6d4a51 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 main 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 @@ -106,7 +125,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 +144,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.' });