Skip to content
flag

GitHub Action

Project labeler

v0.2.0 Latest version

Project labeler

flag

Project labeler

Github Action for adding labels to issues based on project

Installation

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

              

- name: Project labeler

uses: d-i-bondarenko/project-labeler@v0.2.0

Learn more about this action in d-i-bondarenko/project-labeler

Choose a version

Project Labeler

Add labels to issue based on projects it belongs to.

Usage

Step 1. Create .github/project-labeler.yml

Add .github/project-labeler.yml with labels settings for each project.

Example

projects:
  - match: ROADMAP.* # RegExp for project name
    labels: # List of label's rules
      - required: ["Size: M"] # Labels that should be on issues from matching projects
        blacklist: ["Bug"] # If issue has any of blacklist-labels it is ignored by action
      - required: ["Size: S"]
        whitelist: ["Bug"] # Only issues with any of whitelist labels are going to be processed
        blacklist: ["Won't fix"] # In this case label "Size: S" will be added only on issues with "Bug" label and without "Won't fix"
  - match: TECHDEBT.*
    labels:
      - required: ["Area: Infrastructure"]

Step 2. Create Workflow

Common usage of action is on assigned issue event. An example of workflow (eg: .github/workflows/project-labeler.yml see Creating a Workflow file):

name: "Project Labeler"
on:
  issues:
    types:
      - assigned

jobs:
  triage:
    runs-on: ubuntu-latest
    steps:
      - name: Add labels by project
        uses: d-i-bondarenko/project-labeler@v0.2.0
        with:
          repo-token: "${{ secrets.GITHUB_TOKEN }}"