Skip to content
user-check

GitHub Action

label-required-approvals

v1.0.0 Latest version

label-required-approvals

user-check

label-required-approvals

Requires certain team member approvals based on certain labels

Installation

Copy and paste the following snippet into your .yml file.

              

- name: label-required-approvals

uses: lvegerano/label-required-approvals@v1.0.0

Learn more about this action in lvegerano/label-required-approvals

Choose a version

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

Configuration

Create .github/team-approvers.yml

You need to provide a yml file contains the label and the approvers for the label:

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) 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:

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 }}