/issue-label-notification-action

An action to notify individuals or teams when specific labels are added to an issue.

Primary LanguageJavaScript

GitHub Action - Issue Label Notifications

This GitHub Action allows you to notify users or teams when specific labels are added to an issue. It runs every time a label is attached to an issue, and compares the label to the list of notification recipients that you specify. If a match is found, the action will add a comment to the issue and @mention the notification recipients.

Screen Shot 2020-03-27 at 3 30 46 PM

Usage

Pre-requisites

Create a workflow .yml file in your repositories .github/workflows directory. An example workflow is available below. For more information, reference the GitHub Help Documentation for Creating a workflow file.

Inputs

  • token: The GitHub authentication token. This is required for the action to create issue comments.
  • recipients: A map of labels and which individuals or teams to notify. Multiple labels can be configured by putting each on a newline. Multiple teams and/or individuals can be configured for each label by putting a space between them.
  • message: (Optional) The message to include in the comment. Must include at least {receipients} but can also include {label}. See the default message in the action.yml file.

Example workflow

name: Notify users based on issue labels

on:
  issues:
      types: [labeled]

jobs:
  notify:
    runs-on: ubuntu-latest
    steps:
        - uses: jenschelkopf/issue-label-notification-action@1.2
          with:
             token: ${{ secrets.GITHUB_TOKEN }}
             recipients: |
                  help wanted=@jenschelkopf
                  documentation=@jenschelkopf @docs-team