Created
November 3, 2025 19:12
-
-
Save Braunson/923d991a4cccd0d45b3ed64bf95827dd to your computer and use it in GitHub Desktop.
GitHub workaround for Branch rulesets and requiring to subscribe to GitHub Team's. This is more of a strong suggestion rather than a hard block, it will still allow users with write permissions to merge the MR.
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: Require Review | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, review_requested] | |
| pull_request_review: | |
| types: [submitted, dismissed] | |
| jobs: | |
| check-approval: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const reviews = await github.rest.pulls.listReviews({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: context.issue.number | |
| }); | |
| const approved = reviews.data.some(r => r.state === 'APPROVED'); | |
| if (!approved) { | |
| core.setFailed('❌ PR requires at least one approval'); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment