GitHub Action
GitHub Labeler
GitHub Action to manage labels on GitHub (create/rename/update/delete) as code.
If you are interested, check out my other GitHub Actions!
In the repository where you want to perform this action, create the YAML file .github/labels.yml
(you can also set a custom filename) that looks like:
- name: "bug"
color: "d73a4a"
description: "Something isn't working"
- name: "documentation"
color: "0075ca"
description: "Improvements or additions to documentation"
- name: "duplicate"
color: "cfd8d7"
description: "This issue or pull request already exists"
- name: "enhancement"
color: "a22eef"
- name: "wontfix_it"
color: "000000"
description: "This will not be worked on"
from_name: "wontfix"
name
,color
anddescription
are the main GitHub label fieldsdescription
can be omit if your want to keep the current onefrom_name
allow to rename a label from one currently available on your repository
name: github
on: push
jobs:
labeler:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Run Labeler
if: success()
uses: crazy-max/ghaction-github-labeler@v2
with:
yaml_file: .github/labels.yml
skip_delete: false
dry_run: false
exclude: |
help*
*issue
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
With this workflow, the YAML configuration above on a fresh repository, this will:
- Skip
bug
(because samecolor
anddescription
) - Skip
documentation
(because samecolor
anddescription
) - Update
duplicate
(color
is different) - Update
enhancement
(color
is different, keep currentdescription
) - Leave
good first issue
alone (because it matches anexclude
pattern) - Leave
help wanted
alone (because it matches anexclude
pattern) - Delete
invalid
- Delete
question
- Rename
wontfix
towontfix_it
and setcolor
anddescription
Following inputs can be used as step.with
keys
Name | Type | Description |
---|---|---|
yaml_file |
String | Path to YAML file containing labels definitions (default .github/labels.yml ) |
skip_delete |
Bool | If enabled, labels will not be deleted if not found in YAML file (default false ) |
dry_run |
Bool | If enabled, changes will not be applied (default false ) |
exclude |
String | Newline-delimited list of labels pattern(s)/matcher to exclude. |
Following environment variables can be used as step.env
keys
Name | Description |
---|---|
GITHUB_TOKEN |
GITHUB_TOKEN as provided by secrets |
All kinds of contributions are welcome ๐! The most basic way to show your support is to star ๐ the project, or to raise issues ๐ฌ You can also support this project by becoming a sponsor on GitHub ๐ or by making a Paypal donation to ensure this journey continues indefinitely! ๐
Thanks again for your support, it is much appreciated! ๐
MIT. See LICENSE
for more details.