@aspruyt/xfg 3.5.8 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config-validator.js +5 -0
- package/dist/config.d.ts +2 -0
- package/dist/repo-settings-diff.js +2 -0
- package/dist/repo-settings-plan-formatter.js +3 -0
- package/dist/strategies/github-repo-settings-strategy.js +2 -0
- package/dist/strategies/repo-settings-strategy.d.ts +2 -0
- package/package.json +1 -1
package/dist/config-validator.js
CHANGED
|
@@ -318,12 +318,17 @@ function validateRepoSettings(repo, context) {
|
|
|
318
318
|
"secretScanning",
|
|
319
319
|
"secretScanningPushProtection",
|
|
320
320
|
"privateVulnerabilityReporting",
|
|
321
|
+
"webCommitSignoffRequired",
|
|
321
322
|
];
|
|
322
323
|
for (const field of booleanFields) {
|
|
323
324
|
if (r[field] !== undefined && typeof r[field] !== "boolean") {
|
|
324
325
|
throw new Error(`${context}: ${field} must be a boolean`);
|
|
325
326
|
}
|
|
326
327
|
}
|
|
328
|
+
// Validate string fields
|
|
329
|
+
if (r.defaultBranch !== undefined && typeof r.defaultBranch !== "string") {
|
|
330
|
+
throw new Error(`${context}: defaultBranch must be a string`);
|
|
331
|
+
}
|
|
327
332
|
// Validate enum fields
|
|
328
333
|
if (r.visibility !== undefined &&
|
|
329
334
|
!VALID_VISIBILITY.includes(r.visibility)) {
|
package/dist/config.d.ts
CHANGED
|
@@ -239,6 +239,8 @@ export interface GitHubRepoSettings {
|
|
|
239
239
|
allowForking?: boolean;
|
|
240
240
|
visibility?: RepoVisibility;
|
|
241
241
|
archived?: boolean;
|
|
242
|
+
webCommitSignoffRequired?: boolean;
|
|
243
|
+
defaultBranch?: string;
|
|
242
244
|
allowSquashMerge?: boolean;
|
|
243
245
|
allowMergeCommit?: boolean;
|
|
244
246
|
allowRebaseMerge?: boolean;
|
|
@@ -20,6 +20,8 @@ const PROPERTY_MAPPING = {
|
|
|
20
20
|
squashMergeCommitMessage: "squash_merge_commit_message",
|
|
21
21
|
mergeCommitTitle: "merge_commit_title",
|
|
22
22
|
mergeCommitMessage: "merge_commit_message",
|
|
23
|
+
webCommitSignoffRequired: "web_commit_signoff_required",
|
|
24
|
+
defaultBranch: "default_branch",
|
|
23
25
|
vulnerabilityAlerts: "_vulnerability_alerts",
|
|
24
26
|
automatedSecurityFixes: "_automated_security_fixes",
|
|
25
27
|
secretScanning: "_secret_scanning",
|
|
@@ -29,6 +29,9 @@ function getWarning(change) {
|
|
|
29
29
|
change.newValue === false) {
|
|
30
30
|
return `disabling ${change.property} may hide existing content`;
|
|
31
31
|
}
|
|
32
|
+
if (change.property === "defaultBranch") {
|
|
33
|
+
return `changing default branch may affect existing PRs, CI workflows, and branch protections`;
|
|
34
|
+
}
|
|
32
35
|
return undefined;
|
|
33
36
|
}
|
|
34
37
|
/**
|
|
@@ -26,6 +26,8 @@ export interface CurrentRepoSettings {
|
|
|
26
26
|
squash_merge_commit_message?: string;
|
|
27
27
|
merge_commit_title?: string;
|
|
28
28
|
merge_commit_message?: string;
|
|
29
|
+
web_commit_signoff_required?: boolean;
|
|
30
|
+
default_branch?: string;
|
|
29
31
|
security_and_analysis?: {
|
|
30
32
|
secret_scanning?: {
|
|
31
33
|
status: string;
|