Skip to content

GitHub Action to either warn or add a default label when no label with a prefix exists on an issue

License

Notifications You must be signed in to change notification settings

trstringer/require-label-prefix

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

GitHub Action - Require Label Prefix

CI

Use this GitHub action to either warn or add a default label based on prefixes.

Usage

steps:
  - uses: trstringer/require-label-prefix@v1
    with:
      secret: ${{ github.TOKEN }}

      # prefix is set to whatever prefix you are trying to enforce. For
      # instance, if you want to make sure size labels (e.g. "size/S", "size/L")
      # are enforced, the prefix would be "size".
      prefix: size

      # The prefix is divided by the suffix by some separator. This defaults
      # to "/" and is typically this, but it could be anything (e.g. ":").
      # labelSeparator: "/"

      # addLabel, when set to "true", will label the issue with defaultLabel if
      # the issue doesn't have a label with the prefix. If this is set to "false"
      # then a label won't be added, there will just be a comment requesting that
      # somebody adds a label with the labelPrefix.
      # Options: "true", "false" (default).
      # addLabel: false

      # If addLabel is set, defaultLabel is the label that will be added if there
      # is no label with this prefix already on the issue. E.g. "size/needed".
      # defaultLabel: "size/needed"

      # If you want to only comment on or label issues that are part of a milestone
      # then you would set this to "true". Otherwise, all issues are evaluated.
      # Options: "true", "false" (default).
      # onlyMilestone: false