github-settings-as-code 2.1.2 → 3.0.1
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/README.md +21 -15
- package/dist/cmd/repo-settings.d.mts.map +1 -1
- package/dist/cmd/repo-settings.mjs +30 -29
- package/dist/cmd/repo-settings.mjs.map +1 -1
- package/dist/github/actions-settings/api/get-actions-settings.d.mts.map +1 -1
- package/dist/github/actions-settings/api/get-actions-settings.mjs +0 -1
- package/dist/github/actions-settings/api/get-actions-settings.mjs.map +1 -1
- package/dist/github/actions-settings/apply.d.mts +1 -1
- package/dist/github/actions-settings/apply.d.mts.map +1 -1
- package/dist/github/actions-settings/apply.mjs +3 -3
- package/dist/github/actions-settings/apply.mjs.map +1 -1
- package/dist/github/actions-settings/constants.d.mts +87 -1
- package/dist/github/actions-settings/constants.d.mts.map +1 -1
- package/dist/github/actions-settings/constants.mjs +1 -1
- package/dist/github/constants.d.mts.map +1 -1
- package/dist/github/constants.mjs +7 -5
- package/dist/github/constants.mjs.map +1 -1
- package/dist/github/pages/api/get-pages-settings.d.mts.map +1 -1
- package/dist/github/pages/api/get-pages-settings.mjs +0 -1
- package/dist/github/pages/api/get-pages-settings.mjs.map +1 -1
- package/dist/github/pages/apply.d.mts +1 -1
- package/dist/github/pages/apply.mjs +3 -3
- package/dist/github/pages/apply.mjs.map +1 -1
- package/dist/github/pages/constants.d.mts +21 -1
- package/dist/github/pages/constants.d.mts.map +1 -1
- package/dist/github/pages/constants.mjs +1 -1
- package/dist/github/repository/api/get-repository.mjs +2 -2
- package/dist/github/repository/api/get-repository.mjs.map +1 -1
- package/dist/github/repository/api/update-repository.d.mts +1 -1
- package/dist/github/repository/api/update-repository.d.mts.map +1 -1
- package/dist/github/repository/api/update-repository.mjs +5 -2
- package/dist/github/repository/api/update-repository.mjs.map +1 -1
- package/dist/github/repository/apply.mjs +2 -2
- package/dist/github/repository/apply.mjs.map +1 -1
- package/dist/github/repository/constants.d.mts +176 -0
- package/dist/github/repository/constants.d.mts.map +1 -1
- package/dist/github/ruleset/api/get-all-rulesets.mjs +2 -2
- package/dist/github/ruleset/api/get-all-rulesets.mjs.map +1 -1
- package/dist/github/ruleset/api/get-ruleset.mjs +2 -2
- package/dist/github/ruleset/api/get-ruleset.mjs.map +1 -1
- package/dist/github/ruleset/constants.d.mts +88 -8
- package/dist/github/ruleset/constants.d.mts.map +1 -1
- package/dist/github/variables/apply.d.mts.map +1 -1
- package/dist/github/variables/apply.mjs +1 -0
- package/dist/github/variables/apply.mjs.map +1 -1
- package/package.json +22 -27
- package/src/cmd/repo-settings.mts +37 -36
- package/src/github/actions-settings/api/get-actions-settings.mts +0 -1
- package/src/github/actions-settings/apply.mts +3 -3
- package/src/github/actions-settings/constants.mts +1 -1
- package/src/github/constants.mts +10 -5
- package/src/github/pages/api/get-pages-settings.mts +0 -1
- package/src/github/pages/apply.mts +3 -3
- package/src/github/pages/constants.mts +1 -1
- package/src/github/repository/api/get-repository.mts +2 -2
- package/src/github/repository/api/update-repository.mts +6 -1
- package/src/github/repository/apply.mts +2 -2
- package/src/github/ruleset/api/get-all-rulesets.mts +2 -2
- package/src/github/ruleset/api/get-ruleset.mts +2 -2
- package/src/github/ruleset/schema.test.mts +164 -0
- package/src/github/variables/apply.mts +2 -0
|
@@ -9,7 +9,7 @@ export declare const RulesetPicked: Readonly<{
|
|
|
9
9
|
readonly actor_id?: number | null | undefined;
|
|
10
10
|
readonly bypass_mode?: "always" | "exempt" | "pull_request" | undefined;
|
|
11
11
|
} & {
|
|
12
|
-
actor_type: "DeployKey" | "Integration" | "OrganizationAdmin" | "RepositoryRole" | "Team";
|
|
12
|
+
actor_type: "DeployKey" | "Integration" | "OrganizationAdmin" | "RepositoryRole" | "Team" | "User";
|
|
13
13
|
}>>[] | undefined;
|
|
14
14
|
readonly current_user_can_bypass?: "always" | "exempt" | "never" | "pull_requests_only" | undefined;
|
|
15
15
|
readonly node_id?: string | undefined;
|
|
@@ -94,6 +94,14 @@ export declare const RulesetPicked: Readonly<{
|
|
|
94
94
|
}>> | import("ts-type-forge").MergeIntersection<Readonly<{
|
|
95
95
|
readonly parameters?: import("ts-type-forge").MergeIntersection<Readonly<{
|
|
96
96
|
readonly allowed_merge_methods?: readonly ("merge" | "rebase" | "squash")[] | undefined;
|
|
97
|
+
readonly dismissal_restriction?: import("ts-type-forge").MergeIntersection<Readonly<{
|
|
98
|
+
readonly allowed_actors?: readonly Readonly<{
|
|
99
|
+
id: number;
|
|
100
|
+
type: "IntegrationInstallation" | "RepositoryRole" | "Team" | "User";
|
|
101
|
+
}>[] | undefined;
|
|
102
|
+
} & {
|
|
103
|
+
enabled: boolean;
|
|
104
|
+
}>> | undefined;
|
|
97
105
|
readonly required_reviewers?: readonly Readonly<{
|
|
98
106
|
file_patterns: readonly string[];
|
|
99
107
|
minimum_approvals: number;
|
|
@@ -242,6 +250,8 @@ export declare const RulesetPicked: Readonly<{
|
|
|
242
250
|
type: "required_signatures";
|
|
243
251
|
}> | Readonly<{
|
|
244
252
|
type: "non_fast_forward";
|
|
253
|
+
}> | Readonly<{
|
|
254
|
+
type: "license_compliance_scanning";
|
|
245
255
|
}>)[] | undefined;
|
|
246
256
|
readonly created_at?: string | undefined;
|
|
247
257
|
readonly updated_at?: string | undefined;
|
|
@@ -258,7 +268,7 @@ export declare const RulesetPicked: Readonly<{
|
|
|
258
268
|
readonly actor_id?: number | null | undefined;
|
|
259
269
|
readonly bypass_mode?: "always" | "exempt" | "pull_request" | undefined;
|
|
260
270
|
} & {
|
|
261
|
-
actor_type: "DeployKey" | "Integration" | "OrganizationAdmin" | "RepositoryRole" | "Team";
|
|
271
|
+
actor_type: "DeployKey" | "Integration" | "OrganizationAdmin" | "RepositoryRole" | "Team" | "User";
|
|
262
272
|
}>>[] | undefined;
|
|
263
273
|
readonly current_user_can_bypass?: "always" | "exempt" | "never" | "pull_requests_only" | undefined;
|
|
264
274
|
readonly node_id?: string | undefined;
|
|
@@ -343,6 +353,14 @@ export declare const RulesetPicked: Readonly<{
|
|
|
343
353
|
}>> | import("ts-type-forge").MergeIntersection<Readonly<{
|
|
344
354
|
readonly parameters?: import("ts-type-forge").MergeIntersection<Readonly<{
|
|
345
355
|
readonly allowed_merge_methods?: readonly ("merge" | "rebase" | "squash")[] | undefined;
|
|
356
|
+
readonly dismissal_restriction?: import("ts-type-forge").MergeIntersection<Readonly<{
|
|
357
|
+
readonly allowed_actors?: readonly Readonly<{
|
|
358
|
+
id: number;
|
|
359
|
+
type: "IntegrationInstallation" | "RepositoryRole" | "Team" | "User";
|
|
360
|
+
}>[] | undefined;
|
|
361
|
+
} & {
|
|
362
|
+
enabled: boolean;
|
|
363
|
+
}>> | undefined;
|
|
346
364
|
readonly required_reviewers?: readonly Readonly<{
|
|
347
365
|
file_patterns: readonly string[];
|
|
348
366
|
minimum_approvals: number;
|
|
@@ -491,6 +509,8 @@ export declare const RulesetPicked: Readonly<{
|
|
|
491
509
|
type: "required_signatures";
|
|
492
510
|
}> | Readonly<{
|
|
493
511
|
type: "non_fast_forward";
|
|
512
|
+
}> | Readonly<{
|
|
513
|
+
type: "license_compliance_scanning";
|
|
494
514
|
}>)[] | undefined;
|
|
495
515
|
readonly created_at?: string | undefined;
|
|
496
516
|
readonly updated_at?: string | undefined;
|
|
@@ -507,7 +527,7 @@ export declare const RulesetPicked: Readonly<{
|
|
|
507
527
|
readonly actor_id?: number | null | undefined;
|
|
508
528
|
readonly bypass_mode?: "always" | "exempt" | "pull_request" | undefined;
|
|
509
529
|
} & {
|
|
510
|
-
actor_type: "DeployKey" | "Integration" | "OrganizationAdmin" | "RepositoryRole" | "Team";
|
|
530
|
+
actor_type: "DeployKey" | "Integration" | "OrganizationAdmin" | "RepositoryRole" | "Team" | "User";
|
|
511
531
|
}>>[] | undefined;
|
|
512
532
|
readonly current_user_can_bypass?: "always" | "exempt" | "never" | "pull_requests_only" | undefined;
|
|
513
533
|
readonly node_id?: string | undefined;
|
|
@@ -592,6 +612,14 @@ export declare const RulesetPicked: Readonly<{
|
|
|
592
612
|
}>> | import("ts-type-forge").MergeIntersection<Readonly<{
|
|
593
613
|
readonly parameters?: import("ts-type-forge").MergeIntersection<Readonly<{
|
|
594
614
|
readonly allowed_merge_methods?: readonly ("merge" | "rebase" | "squash")[] | undefined;
|
|
615
|
+
readonly dismissal_restriction?: import("ts-type-forge").MergeIntersection<Readonly<{
|
|
616
|
+
readonly allowed_actors?: readonly Readonly<{
|
|
617
|
+
id: number;
|
|
618
|
+
type: "IntegrationInstallation" | "RepositoryRole" | "Team" | "User";
|
|
619
|
+
}>[] | undefined;
|
|
620
|
+
} & {
|
|
621
|
+
enabled: boolean;
|
|
622
|
+
}>> | undefined;
|
|
595
623
|
readonly required_reviewers?: readonly Readonly<{
|
|
596
624
|
file_patterns: readonly string[];
|
|
597
625
|
minimum_approvals: number;
|
|
@@ -740,6 +768,8 @@ export declare const RulesetPicked: Readonly<{
|
|
|
740
768
|
type: "required_signatures";
|
|
741
769
|
}> | Readonly<{
|
|
742
770
|
type: "non_fast_forward";
|
|
771
|
+
}> | Readonly<{
|
|
772
|
+
type: "license_compliance_scanning";
|
|
743
773
|
}>)[] | undefined;
|
|
744
774
|
readonly created_at?: string | undefined;
|
|
745
775
|
readonly updated_at?: string | undefined;
|
|
@@ -756,7 +786,7 @@ export declare const RulesetPicked: Readonly<{
|
|
|
756
786
|
readonly actor_id?: number | null | undefined;
|
|
757
787
|
readonly bypass_mode?: "always" | "exempt" | "pull_request" | undefined;
|
|
758
788
|
} & {
|
|
759
|
-
actor_type: "DeployKey" | "Integration" | "OrganizationAdmin" | "RepositoryRole" | "Team";
|
|
789
|
+
actor_type: "DeployKey" | "Integration" | "OrganizationAdmin" | "RepositoryRole" | "Team" | "User";
|
|
760
790
|
}>>[] | undefined;
|
|
761
791
|
readonly current_user_can_bypass?: "always" | "exempt" | "never" | "pull_requests_only" | undefined;
|
|
762
792
|
readonly node_id?: string | undefined;
|
|
@@ -841,6 +871,14 @@ export declare const RulesetPicked: Readonly<{
|
|
|
841
871
|
}>> | import("ts-type-forge").MergeIntersection<Readonly<{
|
|
842
872
|
readonly parameters?: import("ts-type-forge").MergeIntersection<Readonly<{
|
|
843
873
|
readonly allowed_merge_methods?: readonly ("merge" | "rebase" | "squash")[] | undefined;
|
|
874
|
+
readonly dismissal_restriction?: import("ts-type-forge").MergeIntersection<Readonly<{
|
|
875
|
+
readonly allowed_actors?: readonly Readonly<{
|
|
876
|
+
id: number;
|
|
877
|
+
type: "IntegrationInstallation" | "RepositoryRole" | "Team" | "User";
|
|
878
|
+
}>[] | undefined;
|
|
879
|
+
} & {
|
|
880
|
+
enabled: boolean;
|
|
881
|
+
}>> | undefined;
|
|
844
882
|
readonly required_reviewers?: readonly Readonly<{
|
|
845
883
|
file_patterns: readonly string[];
|
|
846
884
|
minimum_approvals: number;
|
|
@@ -989,6 +1027,8 @@ export declare const RulesetPicked: Readonly<{
|
|
|
989
1027
|
type: "required_signatures";
|
|
990
1028
|
}> | Readonly<{
|
|
991
1029
|
type: "non_fast_forward";
|
|
1030
|
+
}> | Readonly<{
|
|
1031
|
+
type: "license_compliance_scanning";
|
|
992
1032
|
}>)[] | undefined;
|
|
993
1033
|
readonly created_at?: string | undefined;
|
|
994
1034
|
readonly updated_at?: string | undefined;
|
|
@@ -1005,7 +1045,7 @@ export declare const RulesetPicked: Readonly<{
|
|
|
1005
1045
|
readonly actor_id?: number | null | undefined;
|
|
1006
1046
|
readonly bypass_mode?: "always" | "exempt" | "pull_request" | undefined;
|
|
1007
1047
|
} & {
|
|
1008
|
-
actor_type: "DeployKey" | "Integration" | "OrganizationAdmin" | "RepositoryRole" | "Team";
|
|
1048
|
+
actor_type: "DeployKey" | "Integration" | "OrganizationAdmin" | "RepositoryRole" | "Team" | "User";
|
|
1009
1049
|
}>>[] | undefined;
|
|
1010
1050
|
readonly current_user_can_bypass?: "always" | "exempt" | "never" | "pull_requests_only" | undefined;
|
|
1011
1051
|
readonly node_id?: string | undefined;
|
|
@@ -1090,6 +1130,14 @@ export declare const RulesetPicked: Readonly<{
|
|
|
1090
1130
|
}>> | import("ts-type-forge").MergeIntersection<Readonly<{
|
|
1091
1131
|
readonly parameters?: import("ts-type-forge").MergeIntersection<Readonly<{
|
|
1092
1132
|
readonly allowed_merge_methods?: readonly ("merge" | "rebase" | "squash")[] | undefined;
|
|
1133
|
+
readonly dismissal_restriction?: import("ts-type-forge").MergeIntersection<Readonly<{
|
|
1134
|
+
readonly allowed_actors?: readonly Readonly<{
|
|
1135
|
+
id: number;
|
|
1136
|
+
type: "IntegrationInstallation" | "RepositoryRole" | "Team" | "User";
|
|
1137
|
+
}>[] | undefined;
|
|
1138
|
+
} & {
|
|
1139
|
+
enabled: boolean;
|
|
1140
|
+
}>> | undefined;
|
|
1093
1141
|
readonly required_reviewers?: readonly Readonly<{
|
|
1094
1142
|
file_patterns: readonly string[];
|
|
1095
1143
|
minimum_approvals: number;
|
|
@@ -1238,6 +1286,8 @@ export declare const RulesetPicked: Readonly<{
|
|
|
1238
1286
|
type: "required_signatures";
|
|
1239
1287
|
}> | Readonly<{
|
|
1240
1288
|
type: "non_fast_forward";
|
|
1289
|
+
}> | Readonly<{
|
|
1290
|
+
type: "license_compliance_scanning";
|
|
1241
1291
|
}>)[] | undefined;
|
|
1242
1292
|
readonly created_at?: string | undefined;
|
|
1243
1293
|
readonly updated_at?: string | undefined;
|
|
@@ -1254,7 +1304,7 @@ export declare const RulesetPicked: Readonly<{
|
|
|
1254
1304
|
readonly actor_id?: number | null | undefined;
|
|
1255
1305
|
readonly bypass_mode?: "always" | "exempt" | "pull_request" | undefined;
|
|
1256
1306
|
} & {
|
|
1257
|
-
actor_type: "DeployKey" | "Integration" | "OrganizationAdmin" | "RepositoryRole" | "Team";
|
|
1307
|
+
actor_type: "DeployKey" | "Integration" | "OrganizationAdmin" | "RepositoryRole" | "Team" | "User";
|
|
1258
1308
|
}>>[] | undefined;
|
|
1259
1309
|
readonly current_user_can_bypass?: "always" | "exempt" | "never" | "pull_requests_only" | undefined;
|
|
1260
1310
|
readonly node_id?: string | undefined;
|
|
@@ -1339,6 +1389,14 @@ export declare const RulesetPicked: Readonly<{
|
|
|
1339
1389
|
}>> | import("ts-type-forge").MergeIntersection<Readonly<{
|
|
1340
1390
|
readonly parameters?: import("ts-type-forge").MergeIntersection<Readonly<{
|
|
1341
1391
|
readonly allowed_merge_methods?: readonly ("merge" | "rebase" | "squash")[] | undefined;
|
|
1392
|
+
readonly dismissal_restriction?: import("ts-type-forge").MergeIntersection<Readonly<{
|
|
1393
|
+
readonly allowed_actors?: readonly Readonly<{
|
|
1394
|
+
id: number;
|
|
1395
|
+
type: "IntegrationInstallation" | "RepositoryRole" | "Team" | "User";
|
|
1396
|
+
}>[] | undefined;
|
|
1397
|
+
} & {
|
|
1398
|
+
enabled: boolean;
|
|
1399
|
+
}>> | undefined;
|
|
1342
1400
|
readonly required_reviewers?: readonly Readonly<{
|
|
1343
1401
|
file_patterns: readonly string[];
|
|
1344
1402
|
minimum_approvals: number;
|
|
@@ -1487,6 +1545,8 @@ export declare const RulesetPicked: Readonly<{
|
|
|
1487
1545
|
type: "required_signatures";
|
|
1488
1546
|
}> | Readonly<{
|
|
1489
1547
|
type: "non_fast_forward";
|
|
1548
|
+
}> | Readonly<{
|
|
1549
|
+
type: "license_compliance_scanning";
|
|
1490
1550
|
}>)[] | undefined;
|
|
1491
1551
|
readonly created_at?: string | undefined;
|
|
1492
1552
|
readonly updated_at?: string | undefined;
|
|
@@ -1502,7 +1562,7 @@ export declare const RulesetPicked: Readonly<{
|
|
|
1502
1562
|
readonly actor_id?: number | null | undefined;
|
|
1503
1563
|
readonly bypass_mode?: "always" | "exempt" | "pull_request" | undefined;
|
|
1504
1564
|
} & {
|
|
1505
|
-
actor_type: "DeployKey" | "Integration" | "OrganizationAdmin" | "RepositoryRole" | "Team";
|
|
1565
|
+
actor_type: "DeployKey" | "Integration" | "OrganizationAdmin" | "RepositoryRole" | "Team" | "User";
|
|
1506
1566
|
}>>[] | undefined;
|
|
1507
1567
|
readonly current_user_can_bypass?: "always" | "exempt" | "never" | "pull_requests_only" | undefined;
|
|
1508
1568
|
readonly node_id?: string | undefined;
|
|
@@ -1587,6 +1647,14 @@ export declare const RulesetPicked: Readonly<{
|
|
|
1587
1647
|
}>> | import("ts-type-forge").MergeIntersection<Readonly<{
|
|
1588
1648
|
readonly parameters?: import("ts-type-forge").MergeIntersection<Readonly<{
|
|
1589
1649
|
readonly allowed_merge_methods?: readonly ("merge" | "rebase" | "squash")[] | undefined;
|
|
1650
|
+
readonly dismissal_restriction?: import("ts-type-forge").MergeIntersection<Readonly<{
|
|
1651
|
+
readonly allowed_actors?: readonly Readonly<{
|
|
1652
|
+
id: number;
|
|
1653
|
+
type: "IntegrationInstallation" | "RepositoryRole" | "Team" | "User";
|
|
1654
|
+
}>[] | undefined;
|
|
1655
|
+
} & {
|
|
1656
|
+
enabled: boolean;
|
|
1657
|
+
}>> | undefined;
|
|
1590
1658
|
readonly required_reviewers?: readonly Readonly<{
|
|
1591
1659
|
file_patterns: readonly string[];
|
|
1592
1660
|
minimum_approvals: number;
|
|
@@ -1735,6 +1803,8 @@ export declare const RulesetPicked: Readonly<{
|
|
|
1735
1803
|
type: "required_signatures";
|
|
1736
1804
|
}> | Readonly<{
|
|
1737
1805
|
type: "non_fast_forward";
|
|
1806
|
+
}> | Readonly<{
|
|
1807
|
+
type: "license_compliance_scanning";
|
|
1738
1808
|
}>)[] | undefined;
|
|
1739
1809
|
readonly created_at?: string | undefined;
|
|
1740
1810
|
readonly updated_at?: string | undefined;
|
|
@@ -1751,7 +1821,7 @@ export declare const RulesetPicked: Readonly<{
|
|
|
1751
1821
|
readonly actor_id?: number | null | undefined;
|
|
1752
1822
|
readonly bypass_mode?: "always" | "exempt" | "pull_request" | undefined;
|
|
1753
1823
|
} & {
|
|
1754
|
-
actor_type: "DeployKey" | "Integration" | "OrganizationAdmin" | "RepositoryRole" | "Team";
|
|
1824
|
+
actor_type: "DeployKey" | "Integration" | "OrganizationAdmin" | "RepositoryRole" | "Team" | "User";
|
|
1755
1825
|
}>>[] | undefined;
|
|
1756
1826
|
readonly current_user_can_bypass?: "always" | "exempt" | "never" | "pull_requests_only" | undefined;
|
|
1757
1827
|
readonly node_id?: string | undefined;
|
|
@@ -1836,6 +1906,14 @@ export declare const RulesetPicked: Readonly<{
|
|
|
1836
1906
|
}>> | import("ts-type-forge").MergeIntersection<Readonly<{
|
|
1837
1907
|
readonly parameters?: import("ts-type-forge").MergeIntersection<Readonly<{
|
|
1838
1908
|
readonly allowed_merge_methods?: readonly ("merge" | "rebase" | "squash")[] | undefined;
|
|
1909
|
+
readonly dismissal_restriction?: import("ts-type-forge").MergeIntersection<Readonly<{
|
|
1910
|
+
readonly allowed_actors?: readonly Readonly<{
|
|
1911
|
+
id: number;
|
|
1912
|
+
type: "IntegrationInstallation" | "RepositoryRole" | "Team" | "User";
|
|
1913
|
+
}>[] | undefined;
|
|
1914
|
+
} & {
|
|
1915
|
+
enabled: boolean;
|
|
1916
|
+
}>> | undefined;
|
|
1839
1917
|
readonly required_reviewers?: readonly Readonly<{
|
|
1840
1918
|
file_patterns: readonly string[];
|
|
1841
1919
|
minimum_approvals: number;
|
|
@@ -1984,6 +2062,8 @@ export declare const RulesetPicked: Readonly<{
|
|
|
1984
2062
|
type: "required_signatures";
|
|
1985
2063
|
}> | Readonly<{
|
|
1986
2064
|
type: "non_fast_forward";
|
|
2065
|
+
}> | Readonly<{
|
|
2066
|
+
type: "license_compliance_scanning";
|
|
1987
2067
|
}>)[] | undefined;
|
|
1988
2068
|
readonly created_at?: string | undefined;
|
|
1989
2069
|
readonly updated_at?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../../../src/github/ruleset/constants.mts"],"names":[],"mappings":"AAMA,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AAEjC,eAAO,MAAM,iBAAiB,0FAQ2B,CAAC;AAQ1D,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../../../src/github/ruleset/constants.mts"],"names":[],"mappings":"AAMA,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AAEjC,eAAO,MAAM,iBAAiB,0FAQ2B,CAAC;AAQ1D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA+C,CAAC;AAE1E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.d.mts","sourceRoot":"","sources":["../../../src/github/variables/apply.mts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"apply.d.mts","sourceRoot":"","sources":["../../../src/github/variables/apply.mts"],"names":[],"mappings":";AAGA,OAAO,eAAe,CAAC;AAQvB,eAAO,MAAM,cAAc,QAAa,OAAO,CAAC,IAAI,CA6BnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.mjs","sourceRoot":"","sources":["../../../src/github/variables/apply.mts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"apply.mjs","sourceRoot":"","sources":["../../../src/github/variables/apply.mts"],"names":[],"mappings":";AAEA,sBAAsB;AACtB,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,IAAmB,EAAE;IACtD,MAAM,SAAS,GAAG;QAChB;YACE,8CAA8C;YAC9C,mDAAmD;YACnD,IAAI,EAAE,6BAA6B;YACnC,KAAK,EAAE,sBAAsB;SAC9B;QACD;YACE,gDAAgD;YAChD,iEAAiE;YACjE,kDAAkD;YAClD,MAAM;YACN,IAAI,EAAE,+BAA+B;YACrC,KAAK,EAAE,sBAAsB;SAC9B;KACO,CAAC;IAEX,MAAM,iBAAiB,GAAG,MAAM,iBAAiB,EAAE,CAAC;IAEpD,MAAM,cAAc,GAAwB,IAAI,GAAG,CACjD,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CACrC,CAAC;IAEF,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,MAAM,KAAK,GAAG,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEhD,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC9E,CAAC;AACH,CAAC,CAAC;AAEF,IAAI,kBAAkB,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IACxC,MAAM,cAAc,EAAE,CAAC;AACzB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "github-settings-as-code",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"keywords": [
|
|
6
6
|
"github",
|
|
@@ -25,33 +25,34 @@
|
|
|
25
25
|
"LICENSE"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@octokit/core": "^7.0.
|
|
28
|
+
"@octokit/core": "^7.0.8",
|
|
29
|
+
"dedent": "^1.7.2",
|
|
29
30
|
"dotenv": "^17.4.2",
|
|
30
|
-
"octokit-safe-types": "^1.2.
|
|
31
|
-
"ts-data-forge": "^14.2
|
|
32
|
-
"ts-fortress": "^12.0
|
|
33
|
-
"ts-repo-utils": "^10.
|
|
34
|
-
"ts-type-forge": "^9.2.
|
|
31
|
+
"octokit-safe-types": "^1.2.27",
|
|
32
|
+
"ts-data-forge": "^14.6.2",
|
|
33
|
+
"ts-fortress": "^12.1.0",
|
|
34
|
+
"ts-repo-utils": "^10.5.0",
|
|
35
|
+
"ts-type-forge": "^9.2.2"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
|
-
"@types/node": "26.
|
|
38
|
-
"@vitest/coverage-v8": "4.1.
|
|
39
|
-
"@vitest/ui": "4.1.
|
|
40
|
-
"cspell": "10.
|
|
41
|
-
"eslint": "10.
|
|
38
|
+
"@types/node": "26.4.1",
|
|
39
|
+
"@vitest/coverage-v8": "4.1.11",
|
|
40
|
+
"@vitest/ui": "4.1.11",
|
|
41
|
+
"cspell": "10.1.1",
|
|
42
|
+
"eslint": "10.9.1",
|
|
43
|
+
"eslint-config-typed": "5.11.0",
|
|
44
|
+
"eslint-plugin-ts-data-forge": "0.6.1",
|
|
45
|
+
"eslint-plugin-ts-fortress": "1.1.0",
|
|
46
|
+
"eslint-plugin-ts-type-forge": "0.8.0",
|
|
42
47
|
"jiti": "2.7.0",
|
|
43
48
|
"npm-run-all2": "9.0.3",
|
|
44
49
|
"prettier": "3.9.6",
|
|
45
50
|
"prettier-plugin-organize-imports": "4.3.0",
|
|
46
51
|
"prettier-plugin-packagejson": "3.0.2",
|
|
47
|
-
"tsx": "4.23.
|
|
52
|
+
"tsx": "4.23.12",
|
|
48
53
|
"typescript": "6.0.3",
|
|
49
54
|
"typescript-native": "npm:typescript@7.0.2",
|
|
50
|
-
"vitest": "4.1.
|
|
51
|
-
"eslint-config-typed": "5.8.6",
|
|
52
|
-
"eslint-plugin-ts-data-forge": "0.4.5",
|
|
53
|
-
"eslint-plugin-ts-fortress": "1.0.1",
|
|
54
|
-
"eslint-plugin-ts-type-forge": "0.6.3"
|
|
55
|
+
"vitest": "4.1.11"
|
|
55
56
|
},
|
|
56
57
|
"engines": {
|
|
57
58
|
"node": ">=22.22.2",
|
|
@@ -69,15 +70,9 @@
|
|
|
69
70
|
"build:min": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/cmd/build.mts --skip-check",
|
|
70
71
|
"check:ext": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/cmd/check-ext.mts",
|
|
71
72
|
"check-all": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/cmd/check-all.mts",
|
|
72
|
-
"codemod": "
|
|
73
|
-
"codemod:diff": "
|
|
74
|
-
"codemod:
|
|
75
|
-
"codemod:diff:readonly": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ../../libs/ts-codemod-cli/src/cmd/convert-to-readonly.mts --diff-from origin/main '{src,scripts,samples}/**/*.mts'",
|
|
76
|
-
"codemod:full": "run-s codemod:full:as-const fmt codemod:full:readonly fmt",
|
|
77
|
-
"codemod:full:as-const": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ../../libs/ts-codemod-cli/src/cmd/append-as-const.mts '{src,scripts,samples}/**/*.mts'",
|
|
78
|
-
"codemod:full:readonly": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ../../libs/ts-codemod-cli/src/cmd/convert-to-readonly.mts '{src,scripts,samples}/**/*.mts'",
|
|
79
|
-
"codemod:uncommitted:as-const": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ../../libs/ts-codemod-cli/src/cmd/append-as-const.mts --uncommitted '{src,scripts,samples}/**/*.mts'",
|
|
80
|
-
"codemod:uncommitted:readonly": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ../../libs/ts-codemod-cli/src/cmd/convert-to-readonly.mts --uncommitted '{src,scripts,samples}/**/*.mts'",
|
|
73
|
+
"codemod": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ../../libs/ts-codemod-cli/src/cmd/ts-codemod.mts --uncommitted --transformer append-as-const --transformer convert-to-readonly '{src,scripts,samples}/**/*.mts' && pnpm run fmt",
|
|
74
|
+
"codemod:diff": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ../../libs/ts-codemod-cli/src/cmd/ts-codemod.mts --diff-from origin/main --transformer append-as-const --transformer convert-to-readonly '{src,scripts,samples}/**/*.mts' && pnpm run fmt",
|
|
75
|
+
"codemod:full": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ../../libs/ts-codemod-cli/src/cmd/ts-codemod.mts --transformer append-as-const --transformer convert-to-readonly '{src,scripts,samples}/**/*.mts' && pnpm run fmt",
|
|
81
76
|
"cspell": "cspell \"**\" --gitignore --gitignore-root ../../ --no-progress",
|
|
82
77
|
"doc": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/cmd/gen-docs.mts",
|
|
83
78
|
"fmt": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ../../libs/ts-repo-utils/src/cmd/format-uncommitted.mts --cwd .",
|
|
@@ -1,46 +1,47 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
import dedent from 'dedent';
|
|
3
4
|
import 'dotenv/config';
|
|
4
5
|
import * as util from 'node:util';
|
|
5
6
|
import { Arr } from 'ts-data-forge';
|
|
6
7
|
import { type ReadonlyRecord } from 'ts-type-forge';
|
|
7
8
|
|
|
8
|
-
const HELP = `
|
|
9
|
-
Usage: repo-settings <command> [target] [options]
|
|
10
|
-
|
|
11
|
-
GitHub の repository 設定を JSON ファイルで管理する。
|
|
12
|
-
|
|
13
|
-
Commands:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Targets:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
Options:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
owner / repo は「コマンドライン引数 → 環境変数 OWNER / REPO_NAME →
|
|
31
|
-
git remote origin → package.json の name 」の順で解決される。
|
|
32
|
-
通常は git remote から決まるため、どちらの指定も不要。
|
|
33
|
-
|
|
34
|
-
認証は「環境変数 GITHUB_APP_TOKEN / GH_TOKEN / PERSONAL_ACCESS_TOKEN →
|
|
35
|
-
gh CLI ( gh auth token )」の順で解決される。ローカルでは gh auth login
|
|
36
|
-
だけで動く。
|
|
37
|
-
|
|
38
|
-
Examples:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
9
|
+
const HELP = dedent`
|
|
10
|
+
Usage: repo-settings <command> [target] [options]
|
|
11
|
+
|
|
12
|
+
GitHub の repository 設定を JSON ファイルで管理する。
|
|
13
|
+
|
|
14
|
+
Commands:
|
|
15
|
+
apply [target] ローカルの設定ファイルを GitHub に反映する
|
|
16
|
+
backup [target] GitHub の現在値をローカルの bk/ に保存する
|
|
17
|
+
|
|
18
|
+
Targets:
|
|
19
|
+
all すべて(既定)
|
|
20
|
+
repository repo-settings/repository-settings/settings.json
|
|
21
|
+
rulesets repo-settings/rulesets/*.json
|
|
22
|
+
variables repository variables ( apply のみ )
|
|
23
|
+
actions repo-settings/actions-settings/settings.json
|
|
24
|
+
pages repo-settings/pages/settings.json
|
|
25
|
+
|
|
26
|
+
Options:
|
|
27
|
+
--owner <owner> 対象の owner
|
|
28
|
+
--repo <repo> 対象の repository 名
|
|
29
|
+
-h, --help このヘルプを表示する
|
|
30
|
+
|
|
31
|
+
owner / repo は「コマンドライン引数 → 環境変数 OWNER / REPO_NAME →
|
|
32
|
+
git remote origin → package.json の name 」の順で解決される。
|
|
33
|
+
通常は git remote から決まるため、どちらの指定も不要。
|
|
34
|
+
|
|
35
|
+
認証は「環境変数 GITHUB_APP_TOKEN / GH_TOKEN / PERSONAL_ACCESS_TOKEN →
|
|
36
|
+
gh CLI ( gh auth token )」の順で解決される。ローカルでは gh auth login
|
|
37
|
+
だけで動く。
|
|
38
|
+
|
|
39
|
+
Examples:
|
|
40
|
+
repo-settings apply
|
|
41
|
+
repo-settings apply rulesets
|
|
42
|
+
repo-settings backup
|
|
43
|
+
repo-settings apply --owner noshiro-pf --repo ts-repo-utils
|
|
44
|
+
`;
|
|
44
45
|
|
|
45
46
|
const COMMANDS = ['apply', 'backup'] as const;
|
|
46
47
|
|
|
@@ -21,7 +21,6 @@ export const getActionsSettings = async (): Promise<ActionsSettings> => {
|
|
|
21
21
|
{ owner: OWNER, repo: REPO, headers: octokitHeaders },
|
|
22
22
|
);
|
|
23
23
|
|
|
24
|
-
// eslint-disable-next-line unicorn/no-array-fill-with-reference-type
|
|
25
24
|
return ActionsSettings.fill({
|
|
26
25
|
enabled: permissions.data.enabled,
|
|
27
26
|
allowed_actions: permissions.data.allowed_actions,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import 'dotenv/config';
|
|
3
3
|
import * as fs from 'node:fs/promises';
|
|
4
4
|
import * as path from 'node:path';
|
|
5
|
-
import
|
|
5
|
+
import * as t from 'ts-fortress';
|
|
6
6
|
import {
|
|
7
7
|
formatUncommittedFiles,
|
|
8
8
|
isDirectlyExecuted,
|
|
@@ -13,7 +13,7 @@ import { getActionsSettings, setActionsSettings } from './api/index.mjs';
|
|
|
13
13
|
import { backupActionsSettings } from './backup.mjs';
|
|
14
14
|
import { ActionsSettings } from './constants.mjs';
|
|
15
15
|
|
|
16
|
-
/** `
|
|
16
|
+
/** `repo-settings/actions-settings/settings.json` を Settings > Actions > General に反映する。 */
|
|
17
17
|
export const applyActionsSettings = async (): Promise<void> => {
|
|
18
18
|
await backupActionsSettings(false);
|
|
19
19
|
|
|
@@ -51,7 +51,7 @@ const readSettings = async (): Promise<ActionsSettings> => {
|
|
|
51
51
|
|
|
52
52
|
if (Result.isErr(validationResult)) {
|
|
53
53
|
throw new Error(
|
|
54
|
-
validationErrorsToMessages(validationResult.value).join('\n'),
|
|
54
|
+
t.validationErrorsToMessages(validationResult.value).join('\n'),
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
57
|
|
package/src/github/constants.mts
CHANGED
|
@@ -7,20 +7,25 @@ export const OWNER: string = targetRepo.owner;
|
|
|
7
7
|
|
|
8
8
|
export const REPO: string = targetRepo.repo;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// Named `repo-settings` rather than `github`, which read as a sibling of
|
|
11
|
+
// `.github` and invited the guess that workflows lived here too.
|
|
12
|
+
const settingsDir = path.resolve(process.cwd(), './repo-settings');
|
|
11
13
|
|
|
12
14
|
export const settingsJsonName = 'settings.json';
|
|
13
15
|
|
|
14
16
|
export const repositorySettingsDir = path.resolve(
|
|
15
|
-
|
|
17
|
+
settingsDir,
|
|
16
18
|
'./repository-settings',
|
|
17
19
|
);
|
|
18
20
|
|
|
19
|
-
export const actionsSettingsDir = path.resolve(
|
|
21
|
+
export const actionsSettingsDir = path.resolve(
|
|
22
|
+
settingsDir,
|
|
23
|
+
'./actions-settings',
|
|
24
|
+
);
|
|
20
25
|
|
|
21
|
-
export const pagesSettingsDir = path.resolve(
|
|
26
|
+
export const pagesSettingsDir = path.resolve(settingsDir, './pages');
|
|
22
27
|
|
|
23
|
-
export const rulesetsDir = path.resolve(
|
|
28
|
+
export const rulesetsDir = path.resolve(settingsDir, './rulesets');
|
|
24
29
|
|
|
25
30
|
export const octokitHeaders = {
|
|
26
31
|
'X-GitHub-Api-Version': '2022-11-28',
|
|
@@ -19,7 +19,6 @@ export const getPagesSettings = async (): Promise<
|
|
|
19
19
|
{ owner: OWNER, repo: REPO, headers: octokitHeaders },
|
|
20
20
|
);
|
|
21
21
|
|
|
22
|
-
// eslint-disable-next-line unicorn/no-array-fill-with-reference-type
|
|
23
22
|
return PagesSettings.fill({ build_type: response.data.build_type });
|
|
24
23
|
} catch (error) {
|
|
25
24
|
if (isRecord(error) && hasKey(error, 'status') && error.status === 404) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import 'dotenv/config';
|
|
3
3
|
import * as fs from 'node:fs/promises';
|
|
4
4
|
import * as path from 'node:path';
|
|
5
|
-
import
|
|
5
|
+
import * as t from 'ts-fortress';
|
|
6
6
|
import {
|
|
7
7
|
formatUncommittedFiles,
|
|
8
8
|
isDirectlyExecuted,
|
|
@@ -14,7 +14,7 @@ import { getPagesSettings, setPagesSettings } from './api/index.mjs';
|
|
|
14
14
|
import { PagesSettings } from './constants.mjs';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* `
|
|
17
|
+
* `repo-settings/pages/settings.json` を Settings > Pages に反映する。
|
|
18
18
|
*
|
|
19
19
|
* 設定ファイルを置いていない repository では何もしない( Pages を使わない
|
|
20
20
|
* repository で誤って Pages を有効化しないため)。
|
|
@@ -61,7 +61,7 @@ const readSettings = async (settingsPath: string): Promise<PagesSettings> => {
|
|
|
61
61
|
|
|
62
62
|
if (Result.isErr(validationResult)) {
|
|
63
63
|
throw new Error(
|
|
64
|
-
validationErrorsToMessages(validationResult.value).join('\n'),
|
|
64
|
+
t.validationErrorsToMessages(validationResult.value).join('\n'),
|
|
65
65
|
);
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GetRepositoryResponse, type EndpointKeys } from 'octokit-safe-types';
|
|
2
|
-
import
|
|
2
|
+
import * as t from 'ts-fortress';
|
|
3
3
|
import { Result } from 'ts-repo-utils';
|
|
4
4
|
import { octokitHeaders, OWNER, REPO } from '../../constants.mjs';
|
|
5
5
|
import { octokit } from '../../octokit.mjs';
|
|
@@ -20,7 +20,7 @@ export const getRepositorySettings =
|
|
|
20
20
|
const res = GetRepositoryResponse.validate(getRepositoryResult.data);
|
|
21
21
|
|
|
22
22
|
if (Result.isErr(res)) {
|
|
23
|
-
console.warn(validationErrorsToMessages(res.value));
|
|
23
|
+
console.warn(t.validationErrorsToMessages(res.value));
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
type EndpointKeys,
|
|
3
3
|
type UpdateRepositoryRequest,
|
|
4
4
|
} from 'octokit-safe-types';
|
|
5
|
+
import { castDeepMutable } from 'ts-data-forge';
|
|
5
6
|
import { octokitHeaders, OWNER, REPO } from '../../constants.mjs';
|
|
6
7
|
import { octokit } from '../../octokit.mjs';
|
|
7
8
|
|
|
@@ -16,6 +17,8 @@ export const updateRepository = async ({
|
|
|
16
17
|
has_issues,
|
|
17
18
|
has_projects,
|
|
18
19
|
has_wiki,
|
|
20
|
+
has_pull_requests,
|
|
21
|
+
pull_request_creation_policy,
|
|
19
22
|
is_template,
|
|
20
23
|
default_branch,
|
|
21
24
|
allow_squash_merge,
|
|
@@ -47,10 +50,12 @@ export const updateRepository = async ({
|
|
|
47
50
|
homepage,
|
|
48
51
|
private: private_,
|
|
49
52
|
visibility,
|
|
50
|
-
security_and_analysis,
|
|
53
|
+
security_and_analysis: castDeepMutable(security_and_analysis),
|
|
51
54
|
has_issues,
|
|
52
55
|
has_projects,
|
|
53
56
|
has_wiki,
|
|
57
|
+
has_pull_requests,
|
|
58
|
+
pull_request_creation_policy,
|
|
54
59
|
is_template,
|
|
55
60
|
default_branch,
|
|
56
61
|
allow_squash_merge,
|