/auto-reviewer-labeler-action

⚡️ Github action to label your pull requests based on the author name ⚡️

Primary LanguageTypeScriptApache License 2.0Apache-2.0

Auto Reviewer Labeler Action 👥

build test GitHub issues GitHub forks GitHub stars GitHub license Watch on GitHub

This repository provides a GitHub action to automatically label a pull request based reviewers assigned. This is useful if multiple team are working on the same project.

example

Configuration

Create .github/reviewer_labels.yml

You need to provide a yml file that contains the label and a list of the reviewers that assign that label:

'Team Light Triaged':
  assigned:
    teams:
      - '@Company/team-light'
    users:
      - '@Luke'
'Team Dark Triaged':
  assigned:
    teams:
      - '@Company/team-dark'
    users:
      - '@DarkVador'
      - '@Palpatine'

'Team Light Triaged Approved':
  approved:
    teams:
      - '@Company/team-light'

Usage

Create .github/workflows/reviewer-labeler.yml

Create a workflow (eg: .github/workflows/reviewer-labeler.yml see Creating a Workflow file) to utilize the labeler action. This action only needs the GITHUB_TOKEN secret as it interacts with the GitHub API to modify labels. It's working for pull request and issues. The action can be used as such:

on:
  pull_request:
  issues:
name: reviewer-labeler
permissions:
  contents: read
  pull-requests: write
jobs:
  reviewer-labeler:
    runs-on: ubuntu-latest
    steps:
      - uses: Mojang/auto-reviewer-labeler-action@cd44e44ed3a1132038cedcf2f1d908c27b764f04 #v1.0.1
        with:
          repo-token: "${{ secrets.PAT_GITHUB_REPO_SCOPE }}"
          configuration-path: /.github/reviewer_labels.yml