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
+29-15Lines changed: 29 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,9 +36,9 @@ The normal flow is:
36
36
| `-- validate-configs.yml
37
37
|-- config/
38
38
| |-- auto-pruned-labels.jsonc
39
-
| |-- blacklisted-repositories.jsonc
40
39
| |-- labels.jsonc
41
-
| `-- properties.jsonc
40
+
| |-- properties.jsonc
41
+
| `-- repository-filter.jsonc
42
42
`-- scripts/
43
43
|-- export-properties.mjs
44
44
|-- sync-config-labels.mjs
@@ -115,24 +115,37 @@ The starter file is prefilled with GitHub's default labels:
115
115
116
116
If any of those labels exist on this repo, `Config-Label_Sync` excludes them from `labels.jsonc`. If they exist on target repos, `Org-Label-Sync` deletes them.
117
117
118
-
### `config/blacklisted-repositories.jsonc`
118
+
### `config/repository-filter.jsonc`
119
119
120
-
This is the repo blacklist for org sync.
120
+
This controls which repositories `Org-Label-Sync` will target.
121
121
122
-
By default, `Org-Label-Sync` targets every repo in the configured organization. Any repo listed here is skipped.
122
+
The file uses:
123
123
124
-
Entries can be either:
124
+
-`useWhitelist`: when `true`, only repositories in `whitelist` are synced; when `false`, all discovered org repositories are synced except those in `blacklist`
125
+
-`whitelist`: repos to include when whitelist mode is enabled
126
+
-`blacklist`: repos to exclude when whitelist mode is disabled
127
+
128
+
`useWhitelist` defaults to `false`, so blacklist mode is the default behavior.
129
+
130
+
Entries in either list can be either:
125
131
126
132
-`repo-name`
127
133
-`owner/repo-name`
128
134
129
135
Example:
130
136
131
137
```jsonc
132
-
[
133
-
"sandbox-repo",
134
-
"your-org-name/private-internal-tools"
135
-
]
138
+
{
139
+
"useWhitelist":false,
140
+
"whitelist": [
141
+
"sandbox-repo",
142
+
"your-org-name/important-repo"
143
+
],
144
+
"blacklist": [
145
+
"do-not-touch",
146
+
"your-org-name/private-internal-tools"
147
+
]
148
+
}
136
149
```
137
150
138
151
## Workflows
@@ -176,7 +189,8 @@ Validation includes:
176
189
- JSONC parsing
177
190
- required property checks
178
191
- duplicate label detection
179
-
- duplicate blacklist detection
192
+
- repository filter shape and `useWhitelist` validation
193
+
- duplicate whitelist and blacklist detection
180
194
- invalid colors
181
195
- invalid repo names
182
196
- overlap detection between `labels.jsonc` and `auto-pruned-labels.jsonc`
@@ -193,7 +207,7 @@ Inputs:
193
207
194
208
-`dry_run`: preview changes without writing them
195
209
-`delete_missing`: override `deleteMissingByDefault` for the run
196
-
-`repositories`: optional comma-separated subset of discovered repositories
210
+
-`repositories`: optional comma-separated subset of repositories after `repository-filter.jsonc` is applied
197
211
198
212
What it does:
199
213
@@ -202,7 +216,7 @@ What it does:
202
216
3. Loads shared settings from `config/properties.jsonc`
203
217
4. Validates the updated config
204
218
5. Discovers repos in the configured organization
205
-
6.Skips repos in `config/blacklisted-repositories.jsonc`
219
+
6.Applies `config/repository-filter.jsonc`
206
220
7. Creates or updates labels from `config/labels.jsonc`
207
221
8. Deletes labels listed in `config/auto-pruned-labels.jsonc`
208
222
9. Optionally deletes any other unmanaged labels if `delete_missing` or `deleteMissingByDefault` is enabled
@@ -224,14 +238,14 @@ That token needs enough access to:
224
238
2. Create the sync token secret in the repo.
225
239
3. Update `config/properties.jsonc` for your org and repo.
226
240
4. Adjust `config/auto-pruned-labels.jsonc` if you want a different always-delete list.
227
-
5.Add any excluded repos to `config/blacklisted-repositories.jsonc`.
241
+
5.Configure `config/repository-filter.jsonc` for blacklist mode or whitelist mode.
228
242
6. Set the labels on this repository to the label set you want to manage.
229
243
7. Run `Config-Label_Sync` once if you want to populate `config/labels.jsonc` immediately.
230
244
8. Run `Org-Label-Sync` to propagate the labels across the organization.
231
245
232
246
## Safe Defaults
233
247
234
248
-`labels.jsonc` starts empty until you define or sync labels on this repo
235
-
- all repos in the org are targeted unless blacklisted
249
+
- all repos in the org are targeted unless excluded by `repository-filter.jsonc`
236
250
- GitHub default labels are auto-pruned by default
237
251
- deleting unmanaged labels is off by default unless you enable it
0 commit comments