Cleans up the titles of issues and PRs from common opening keywords
MIT License
Cleans up the titles of issues and PRs from common opening keywords
GitHub offers issue templates with pre-defined labels, but that doesn't stop users from cluttering the titles with the same piece of information already offered by labels.
This action:
You can either run it without inputs to use its defaults or specify your own keywords/labels combination.
Title examples:
Note: keywords in titles are only recognized if followed by one of these characters: :-)]
Note: If no inputs are supplied, the action will use the defaults.
name: Labeler
on:
pull_request_target:
types: [opened, edited]
issues:
types: [opened, edited]
jobs:
Label:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: fregante/title-to-labels-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
You can automatically install the above with ghat:
npx ghat fregante/title-to-labels-action/workflow
Note: If no inputs are supplied, the action will use the defaults.
keywords
- The keywords to look for, separed by comma or newline. Case-insensitive.labels
- The labels to apply when one of the keywords was found. Optional.Either use one keyword per line or comma-separed values.
Note: Do not use lists starting with -
, Actions doesn't support them.
Examples:
name: Labeler
on:
pull_request_target:
types: [opened, edited]
issues:
types: [opened, edited]
jobs:
Label:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: fregante/title-to-labels-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
keywords: idea
# If you don't specify `labels`, the action will just clean up the titles from your keywords.
# The action can be used as many times as needed in a single job
- uses: fregante/title-to-labels-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
keywords: bug, bug report
labels: bug
- uses: fregante/title-to-labels-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
keywords: |
feature request
suggestions
enhancement
labels: |
enhancement
None.