v1.0.0–RC.2 #80
  
    
      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: Enforce Branch Policy | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| enforce-branch-policy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Enforce main branch pull request policy | |
| if: github.event_name == 'pull_request' && github.ref == 'refs/heads/main' | |
| run: | | |
| echo "Pull requests to the main branch are not allowed." | |
| exit 1 | |
| - name: Enforce main branch push policy | |
| run: | | |
| echo "Push events to the main branch are allowed." | |
| exit 0 |