Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lvegerano/label-required-approvals
Github action to require pull requests reviews based on labels applied ✅
https://github.com/lvegerano/label-required-approvals
actions code-reviews github-actions labels reviews workflow
Last synced: 10 days ago
JSON representation
Github action to require pull requests reviews based on labels applied ✅
- Host: GitHub
- URL: https://github.com/lvegerano/label-required-approvals
- Owner: lvegerano
- License: mit
- Created: 2022-07-27T21:31:30.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-16T19:27:58.000Z (over 1 year ago)
- Last Synced: 2024-10-14T09:11:18.506Z (about 1 month ago)
- Topics: actions, code-reviews, github-actions, labels, reviews, workflow
- Language: TypeScript
- Homepage:
- Size: 479 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Label Required Approvals Action
This is a Github Action to require the approval of a Pull Reques from a team member based on the labels applied to it.
![example](./assets/checks.png)## Configuration
### Create `.github/team-approvers.yml`
You need to provide a yml file contains the label and the approvers for the label:
```yml
BlackAjah:
- Alviarin
- Liandrin
BlueAjah:
- Moiranie
- Siuan
```_NOTE_: only one team member per label is required to approve.
### Action Inputs
| input | description | required | default value |
| ------------------- | ------------------------------------------------------------------------------------------- | -------- | ---------------------------- |
| repo-token | The GITHUB_TOKEN secret or a PAT that allows PR management | true | _undefined_ |
| status | Specifies the 'context' for the status to be set. This will show up in the PR's checks list | false | _Required Reviews_ |
| configureation-path | Path to the label -> approvers configuration file | false | _.github/team-approvers.yml_ |## Usage
### Create `.github/workflows/label-approvers.yml`
Create a workflow (e.g. `github/workflows/label-approvers.yml` see [Creating a Workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file)) to utilize the action. This action only needs the `GITHUB_TOKEN` secret or another token with sufficient permissions to modify labels via the Github API. The action can be use as such:
```yml
name: label-required-approvals
on:
pull_request_review:
pull_request:
types: [opened, reopened, labeled, unlabeled]
jobs
required-approvals:
runs-on: ubuntu-latest
steps:
uses: lvegerano/label-required-approvals@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
```