Skip to content

Commit 8450339

Browse files
committed
Add JSON schemas for safe-settings configuration at repo, org, and suborg levels
- Introduced `repos.json` schema for repository-level safe-settings overrides. - Updated `settings.json` schema to include additional properties for org-level configurations. - Created `suborgs.json` schema for suborg-level safe-settings configuration. - Enhanced the build script to dereference all schemas and handle errors during the process.
1 parent d57526e commit 8450339

8 files changed

Lines changed: 6511 additions & 112 deletions

File tree

lib/plugins/custom_properties.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ module.exports = class CustomProperties extends Diffable {
1212

1313
// Force all names to lowercase to avoid comparison issues.
1414
normalizeEntries () {
15-
this.entries = this.entries.map(({ name, value }) => ({
16-
name: name.toLowerCase(),
17-
value
18-
}))
15+
this.entries = this.entries
16+
.filter(({ name }) => name != null)
17+
.map(({ name, value }) => ({
18+
name: name.toLowerCase(),
19+
value
20+
}))
1921
}
2022

2123
async find () {
@@ -38,10 +40,12 @@ module.exports = class CustomProperties extends Diffable {
3840

3941
// Force all names to lowercase to avoid comparison issues.
4042
normalize (properties) {
41-
return properties.map(({ property_name: propertyName, value }) => ({
42-
name: propertyName.toLowerCase(),
43-
value
44-
}))
43+
return properties
44+
.filter(({ property_name: propertyName }) => propertyName != null)
45+
.map(({ property_name: propertyName, value }) => ({
46+
name: propertyName.toLowerCase(),
47+
value
48+
}))
4549
}
4650

4751
comparator (existing, attrs) {

schema/dereferenced/repos.json

Lines changed: 2742 additions & 0 deletions
Large diffs are not rendered by default.

schema/dereferenced/settings.json

Lines changed: 52 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,57 @@
9696
"description": "Can be `enabled` or `disabled`."
9797
}
9898
}
99+
},
100+
"secret_scanning_delegated_alert_dismissal": {
101+
"type": "object",
102+
"description": "Use the `status` property to enable or disable secret scanning delegated alert dismissal for this repository.",
103+
"properties": {
104+
"status": {
105+
"type": "string",
106+
"description": "Can be `enabled` or `disabled`."
107+
}
108+
}
109+
},
110+
"secret_scanning_delegated_bypass": {
111+
"type": "object",
112+
"description": "Use the `status` property to enable or disable secret scanning delegated bypass for this repository.",
113+
"properties": {
114+
"status": {
115+
"type": "string",
116+
"description": "Can be `enabled` or `disabled`."
117+
}
118+
}
119+
},
120+
"secret_scanning_delegated_bypass_options": {
121+
"type": "object",
122+
"description": "Feature options for secret scanning delegated bypass.\nThis object is only honored when `security_and_analysis.secret_scanning_delegated_bypass.status` is set to `enabled`.\nYou can send this object in the same request as `secret_scanning_delegated_bypass`, or update just the options in a separate request.",
123+
"properties": {
124+
"reviewers": {
125+
"type": "array",
126+
"description": "The bypass reviewers for secret scanning delegated bypass.\nIf you omit this field, the existing set of reviewers is unchanged.",
127+
"items": {
128+
"type": "object",
129+
"required": [
130+
"reviewer_id",
131+
"reviewer_type"
132+
],
133+
"properties": {
134+
"reviewer_id": {
135+
"type": "integer",
136+
"description": "The ID of the team or role selected as a bypass reviewer"
137+
},
138+
"reviewer_type": {
139+
"type": "string",
140+
"description": "The type of the bypass reviewer",
141+
"enum": [
142+
"TEAM",
143+
"ROLE"
144+
]
145+
}
146+
}
147+
}
148+
}
149+
}
99150
}
100151
}
101152
},
@@ -155,7 +206,7 @@
155206
},
156207
"use_squash_pr_title_as_default": {
157208
"type": "boolean",
158-
"description": "Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property is closing down. Please use `squash_merge_commit_title` instead.**",
209+
"description": "Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property is closing down. Please use `squash_merge_commit_title` instead.",
159210
"default": false,
160211
"deprecated": true
161212
},
@@ -386,15 +437,6 @@
386437
"notifications_disabled"
387438
]
388439
},
389-
"permission": {
390-
"type": "string",
391-
"description": "**Closing down notice**. The permission that new repositories will be added to the team with when none is specified.",
392-
"enum": [
393-
"pull",
394-
"push"
395-
],
396-
"default": "pull"
397-
},
398440
"parent_team_id": {
399441
"type": "integer",
400442
"description": "The ID of a team to set as the parent team."

0 commit comments

Comments
 (0)