Skip to content

Commit 6016493

Browse files
committed
docs: update README
1 parent 45c79b8 commit 6016493

File tree

1 file changed

+53
-2
lines changed

1 file changed

+53
-2
lines changed

README.md

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
# This is needed in order to edit the labels
2020
token: ${{ secrets.GITHUB_TOKEN }}
2121

22-
# If you want to use a config file, you can put its path here
22+
# If you want to use a config file, you can put its path here (more info in the paragraphs below)
2323
config-file: .github/labels.yml
2424

2525
# If you want to use a source repo, you can put is name here (only the owner/repo format is accepted)
@@ -34,4 +34,55 @@ jobs:
3434
dry-run: true
3535
```
3636
37-
This is only a sample workflow to illustrate all the options: if you want to see an actual workflow you can check the one in this repo [here](.github/workflows/labels.yml).
37+
This is only a sample workflow to illustrate all the options: if you want to see an actual workflow you can check out the one in this repo [here](.github/workflows/labels.yml).
38+
39+
### Config files
40+
41+
If you want to use a config file you can create your own following the instructions below.
42+
43+
If you want to start off by copying the labels from another repository, you can use my [`EndBug/export-label-config` action](https://github.com/EndBug/export-label-config), that will generate one for you.
44+
45+
How to create a config file:
46+
- Create a JSON or YAML file, with one of these extensions: `.json`, `.yaml`, `.yml`.
47+
- Every label should be an array element: add some square brackets `[]` if you need to.
48+
- Every element of the array should be an object with the following properties:
49+
- `name` - The name of the label.
50+
- `color` - The color of the label.
51+
- `description` - [optional] The description of the label.
52+
- `aliases` - [optional] An array containing the "aliases" of the label. If an existing label's name is an alias that label will be edited to match your config: this way you don't loose issues and PRs that have been labeled previously.
53+
54+
This is how it would end up looking:
55+
56+
```yaml
57+
- name: A label
58+
color: '000000'
59+
60+
- name: Another label
61+
color: '111111'
62+
description: A very inspiring description
63+
64+
- name: Yet another label
65+
color: '222222'
66+
aliases: [ 'first', 'second', 'third' ]
67+
```
68+
69+
```json
70+
[
71+
{
72+
"name": "A label",
73+
"color": "000000"
74+
},
75+
{
76+
"name": "Another label",
77+
"color": "111111",
78+
"description": "A very inspiring description"
79+
},
80+
{
81+
"name": "Yet another label",
82+
"color": "222222",
83+
"aliases": [ "first", "second", "third" ]
84+
}
85+
]
86+
```
87+
88+
If you want to see an actual config file, you can check out the one in this repo [here](.github/labels.yml).

0 commit comments

Comments
 (0)