Add labels to issue based on projects it belongs to.
Add .github/project-labeler.yml
with labels settings for each project.
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"]
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/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"