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
+51-23Lines changed: 51 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,16 +65,40 @@ The App listens to the following webhook events:
65
65
If you rename a `<repo.yml>` that corresponds to a repo, safe-settings will rename the repo to the new name. This behavior will take effect whether the env variable `BLOCK_REPO_RENAME_BY_HUMAN` is set or not.
66
66
67
67
### Restricting `safe-settings` to specific repos
68
-
`safe-settings` can be turned on only to a subset of repos by specifying them in the runtime settings file, `deployment-settings.yml`. If no file is specified, then the following repositories - `'admin', '.github', 'safe-settings'` are exempted by default.
69
-
A sample of `deployment-settings` file is found [here](docs/sample-settings/sample-deployment-settings.yml).
70
-
71
-
To apply `safe-settings`__only__ to a specific list of repos, add them to the `restrictedRepos` section as `include` array.
72
68
73
-
To ignore `safe-settings` for a specific list of repos, add them to the `restrictedRepos` section as `exclude` array.
69
+
To restrict which repositories `safe-settings` can manage, create a `deployment-settings.yml` file. This file controls the app's scope throught the `restrictedRepos` configuration:
70
+
71
+
```yml
72
+
# Using include/exclude
73
+
restrictedRepos:
74
+
include:
75
+
- api
76
+
- core-* # Matches `core-api`, `core-service`, etc.
77
+
exclude:
78
+
- admin
79
+
- .github
80
+
- safe-settings
81
+
- test-* # Matches `test-repo`, etc.
82
+
83
+
# Or using simple array syntax for includes
84
+
restrictedRepos:
85
+
- admin
86
+
- .github
87
+
# ...
88
+
```
74
89
75
90
> [!NOTE]
76
-
> The `include` and `exclude` attributes support as well regular expressions.
77
-
> By default they look for regex, Example include: ['SQL'] will look apply to repos with SQL and SQL_ and SQL- etc if you want only SQL repo then use include:['^SQL$']
91
+
> Pattern matching uses glob expressions, e.g use * for wildcards.
92
+
93
+
When using `include` and `exclude`:
94
+
95
+
- If `include` is specified, will **only** run on repositories that match pattern(s)
96
+
- If `exlcude` is specified, will run on all repositories **expect** those matching pattern(s)
97
+
- If both are specified, will run only on included repositories that are'nt excluded
98
+
99
+
By default, if no configuration file is provided, `safe-settings` will excludes these repos: `admin`, `.github` and `safe-settings`.
100
+
101
+
See our [deployment-settings.yml sample](docs/sample-settings/sample-deployment-settings.yml).
78
102
79
103
### Custom rules
80
104
@@ -290,24 +314,28 @@ The following can be configured:
> It is possible to provide an `include` or `exclude` settings to restrict the `collaborators`, `teams`, `labels` to a list of repos or exclude a set of repos for a collaborator.
295
-
> The include/exclude pattern can also be for glob. For e.g.:
296
-
```
297
-
teams:
298
-
- name: Myteam-admins
299
-
permission: admin
300
-
- name: Myteam-developers
301
-
permission: push
302
-
- name: Other-team
303
-
permission: push
304
-
include:
305
-
- '*-config'
306
-
```
307
-
> Will only add `Other-team` to only `*-config` repos
308
-
309
317
See [`docs/sample-settings/settings.yml`](docs/sample-settings/settings.yml) for a sample settings file.
310
318
319
+
> [!note]
320
+
> When using `collaborators`, `teams` or `labels`, you can control which repositories they apply to using `include` and `exclude`:
321
+
>
322
+
> - If `include` is specified, settings will **only** apply to repositories that match those patterns
323
+
> - If `exclude` is specified, settings will apply to all repositories **except** those matching the patterns
324
+
> - If both are specified, `exclude` takes precedence over `include` but `include` patterns will still be respected
325
+
>
326
+
> Pattern matching uses glob expressions, e.g use * for wildcards. For example:
0 commit comments