Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/peckjon/reject-pr-approval-from-committer
GitHub Action to reject approval of a pull request by any committer to that pull request
https://github.com/peckjon/reject-pr-approval-from-committer
Last synced: 2 months ago
JSON representation
GitHub Action to reject approval of a pull request by any committer to that pull request
- Host: GitHub
- URL: https://github.com/peckjon/reject-pr-approval-from-committer
- Owner: peckjon
- License: mit
- Created: 2022-06-13T16:59:46.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-06-18T01:35:38.000Z (7 months ago)
- Last Synced: 2024-09-18T17:17:15.176Z (4 months ago)
- Language: TypeScript
- Homepage:
- Size: 753 KB
- Stars: 11
- Watchers: 0
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# GitHub Action: do not allow committers on a Pull Request to approve the PR
While GitHub prevents self-approval of PRs, it doesn't prevent a user from approving a PR they worked on. In some scenarios, this could allow for PRs to be approved with no outside review.
This action prevents any committers on a Pull Request from approving the PR. It can be used standalone (e.g. triggered by on all submitted Pull Requests in a repo), or as a Required Status Check.
## Usage instructions
Create a workflow file (e.g. `.github/workflows/reject-self-approve.yml`) that contains a step
that has `uses: peckjon/reject-pr-approval-from-committer`.The workflow using this action is supposed to be triggered by `pull_request` or `pull_request_target` event.
Here's an example workflow file:
```yaml
name: Prevent committers from approving a PRon:
pull_request_review:
types: [submitted]jobs:
preventapprove:
name: reject PR approval by committers to the PR
runs-on: ubuntu-latest
if: github.event.review.state == 'approved'
steps:
- name: Dismiss code reviews from collaborators
uses: peckjon/reject-pr-approval-from-committer@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
```