You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+41-9
Original file line number
Diff line number
Diff line change
@@ -15,15 +15,18 @@ jobs:
15
15
runs-on: ubuntu-latest
16
16
17
17
steps:
18
-
- uses: EndBug/label-sync@v1
18
+
- uses: EndBug/label-sync@v2
19
19
with:
20
-
# If you want to use a config file, you can put its path here (more info in the paragraphs below)
21
-
config-file: .github/labels.yml
20
+
# If you want to use a config file, you can put its path or URL here (more info in the paragraphs below)
21
+
config-file:
22
+
.github/labels.yml
23
+
# If URL: "https://raw.githubusercontent.com/EndBug/label-sync/main/.github/labels.yml"
22
24
23
25
# If you want to use a source repo, you can put is name here (only the owner/repo format is accepted)
24
26
source-repo: owner/repo
25
-
# If you're using a private source repo, you'll need to add a custom token for the action to read it
26
-
source-repo-token: ${{ secrets.YOUR_OWN_SECRET }}
27
+
28
+
# If you're using a private source repo or a URL that needs an 'Authorization' header, you'll need to add a custom token for the action to read it
29
+
request-token: ${{ secrets.YOUR_OWN_SECRET }}
27
30
28
31
# If you want to delete any additional label, set this to true
29
32
delete-other-labels: false
@@ -57,15 +60,15 @@ This is how it would end up looking:
57
60
58
61
```yaml
59
62
- name: A label
60
-
color: "000000"
63
+
color: '000000'
61
64
62
65
- name: Another label
63
-
color: "111111"
66
+
color: '111111'
64
67
description: A very inspiring description
65
68
66
69
- name: Yet another label
67
-
color: "222222"
68
-
aliases: ["first", "second", "third"]
70
+
color: '222222'
71
+
aliases: ['first', 'second', 'third']
69
72
```
70
73
71
74
```json
@@ -88,3 +91,32 @@ This is how it would end up looking:
88
91
```
89
92
90
93
If you want to see an actual config file, you can check out the one in this repo [here](.github/labels.yml).
94
+
95
+
This action can either read a local file or fetch it from a custom URL.
96
+
If you want to use a URL make sure that the data field of the response contains JSON or YAML text that follows the structure above.
97
+
98
+
An example of how you may want to use a URL instead of a local file is if you want to use a config file that is located in a GitHub repo, without having to copy it to your own.
99
+
You can use the "raw" link that GitHub provides for the file:
100
+
101
+
```yaml
102
+
- uses: EndBug/label-sync@v2
103
+
with:
104
+
# This is just an example, but any valid URL can be used
This is different than using the `source-repo` option, since this also allows you to use aliases, if the config file has any. If you use the `source-repo` option the action will only copy over the missing labels and update colors, wihtout updating or deleting anything else.
109
+
110
+
If the URL you're using needs an `Authorization` header (like if, for example, you're fetching it from a private repo), you can put its value in the `request-token` input:
# Remember not to put PATs in files, use GitHub secrets instead
117
+
request-token: ${{ secrets.YOUR_CUSTOM_PAT }}
118
+
```
119
+
120
+
The `request-token` input can also be used with a `source-repo`, if that repo is private.
121
+
122
+
If your URL needs a more elaborate request, it's better if you perform it separately and save its output to a local file. You can then run the action using the local config file you just created.
Copy file name to clipboardexpand all lines: action.yml
+3-3
Original file line number
Diff line number
Diff line change
@@ -13,13 +13,13 @@ inputs:
13
13
default: ${{ github.token }}
14
14
15
15
config-file:
16
-
description: The path to the JSON or YAML file containing the label config (more info in the README)
16
+
description: The path (or URL) to the JSON or YAML file containing the label config (more info in the README)
17
17
required: false
18
18
source-repo:
19
19
description: The repo to copy labels from (if not using a config file), in the 'owner/repo' format
20
20
required: false
21
-
source-repo-token:
22
-
description: A token to use if the source repo is private
21
+
request-token:
22
+
description: The token to use in the 'Authorization' header (if 'config-file' is being used) or to access the repo (if a private 'source-repo' is being used)
0 commit comments