github-settings-as-code 1.2.10 → 2.0.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/README.md +60 -9
- package/dist/cmd/{gh-apply-all.d.mts → repo-settings.d.mts} +1 -1
- package/dist/cmd/repo-settings.d.mts.map +1 -0
- package/dist/cmd/repo-settings.mjs +118 -0
- package/dist/cmd/repo-settings.mjs.map +1 -0
- package/dist/github/actions-settings/api/get-actions-settings.d.mts +8 -0
- package/dist/github/actions-settings/api/get-actions-settings.d.mts.map +1 -0
- package/dist/github/actions-settings/api/get-actions-settings.mjs +25 -0
- package/dist/github/actions-settings/api/get-actions-settings.mjs.map +1 -0
- package/dist/github/actions-settings/api/index.d.mts +3 -0
- package/dist/github/actions-settings/api/index.d.mts.map +1 -0
- package/dist/github/actions-settings/api/index.mjs +3 -0
- package/dist/github/actions-settings/api/index.mjs.map +1 -0
- package/dist/github/actions-settings/api/set-actions-settings.d.mts +4 -0
- package/dist/github/actions-settings/api/set-actions-settings.d.mts.map +1 -0
- package/dist/github/actions-settings/api/set-actions-settings.mjs +27 -0
- package/dist/github/actions-settings/api/set-actions-settings.mjs.map +1 -0
- package/dist/github/actions-settings/apply.d.mts +5 -0
- package/dist/github/actions-settings/apply.d.mts.map +1 -0
- package/dist/github/actions-settings/apply.mjs +39 -0
- package/dist/github/actions-settings/apply.mjs.map +1 -0
- package/dist/github/actions-settings/backup.d.mts +5 -0
- package/dist/github/actions-settings/backup.d.mts.map +1 -0
- package/dist/github/actions-settings/backup.mjs +22 -0
- package/dist/github/actions-settings/backup.mjs.map +1 -0
- package/dist/github/actions-settings/constants.d.mts +69 -0
- package/dist/github/actions-settings/constants.d.mts.map +1 -0
- package/dist/github/actions-settings/constants.mjs +42 -0
- package/dist/github/actions-settings/constants.mjs.map +1 -0
- package/dist/github/actions-settings/index.d.mts +5 -0
- package/dist/github/actions-settings/index.d.mts.map +1 -0
- package/dist/github/actions-settings/index.mjs +5 -0
- package/dist/github/actions-settings/index.mjs.map +1 -0
- package/dist/github/constants.d.mts +3 -1
- package/dist/github/constants.d.mts.map +1 -1
- package/dist/github/constants.mjs +7 -31
- package/dist/github/constants.mjs.map +1 -1
- package/dist/github/index.d.mts +4 -0
- package/dist/github/index.d.mts.map +1 -1
- package/dist/github/index.mjs +4 -0
- package/dist/github/index.mjs.map +1 -1
- package/dist/github/octokit.d.mts.map +1 -1
- package/dist/github/octokit.mjs +39 -3
- package/dist/github/octokit.mjs.map +1 -1
- package/dist/github/pages/api/get-pages-settings.d.mts +8 -0
- package/dist/github/pages/api/get-pages-settings.d.mts.map +1 -0
- package/dist/github/pages/api/get-pages-settings.mjs +26 -0
- package/dist/github/pages/api/get-pages-settings.mjs.map +1 -0
- package/dist/github/pages/api/index.d.mts +3 -0
- package/dist/github/pages/api/index.d.mts.map +1 -0
- package/dist/github/pages/api/index.mjs +3 -0
- package/dist/github/pages/api/index.mjs.map +1 -0
- package/dist/github/pages/api/set-pages-settings.d.mts +9 -0
- package/dist/github/pages/api/set-pages-settings.d.mts.map +1 -0
- package/dist/github/pages/api/set-pages-settings.mjs +33 -0
- package/dist/github/pages/api/set-pages-settings.mjs.map +1 -0
- package/dist/github/pages/apply.d.mts +10 -0
- package/dist/github/pages/apply.d.mts.map +1 -0
- package/dist/github/pages/apply.mjs +49 -0
- package/dist/github/pages/apply.mjs.map +1 -0
- package/dist/github/pages/backup.d.mts +5 -0
- package/dist/github/pages/backup.d.mts.map +1 -0
- package/dist/github/pages/backup.mjs +26 -0
- package/dist/github/pages/backup.mjs.map +1 -0
- package/dist/github/pages/constants.d.mts +42 -0
- package/dist/github/pages/constants.d.mts.map +1 -0
- package/dist/github/pages/constants.mjs +14 -0
- package/dist/github/pages/constants.mjs.map +1 -0
- package/dist/github/pages/index.d.mts +5 -0
- package/dist/github/pages/index.d.mts.map +1 -0
- package/dist/github/pages/index.mjs +5 -0
- package/dist/github/pages/index.mjs.map +1 -0
- package/dist/github/repository/apply.d.mts.map +1 -1
- package/dist/github/repository/apply.mjs +4 -4
- package/dist/github/repository/apply.mjs.map +1 -1
- package/dist/github/repository/backup.d.mts.map +1 -1
- package/dist/github/repository/backup.mjs +2 -2
- package/dist/github/repository/backup.mjs.map +1 -1
- package/dist/github/repository/constants.d.mts +3259 -2024
- package/dist/github/repository/constants.d.mts.map +1 -1
- package/dist/github/repository/constants.mjs +2 -1
- package/dist/github/repository/constants.mjs.map +1 -1
- package/dist/github/resolve-target-repo.d.mts +16 -0
- package/dist/github/resolve-target-repo.d.mts.map +1 -0
- package/dist/github/resolve-target-repo.mjs +113 -0
- package/dist/github/resolve-target-repo.mjs.map +1 -0
- package/dist/github/ruleset/api/get-all-rulesets.d.mts.map +1 -1
- package/dist/github/ruleset/api/get-all-rulesets.mjs.map +1 -1
- package/dist/github/ruleset/constants.d.mts +750 -267
- package/dist/github/ruleset/constants.d.mts.map +1 -1
- package/dist/github/ruleset/constants.mjs +2 -1
- package/dist/github/ruleset/constants.mjs.map +1 -1
- package/dist/github/upgrade-stale-codec.d.mts +19 -0
- package/dist/github/upgrade-stale-codec.d.mts.map +1 -0
- package/dist/github/upgrade-stale-codec.mjs +20 -0
- package/dist/github/upgrade-stale-codec.mjs.map +1 -0
- package/dist/github/variables/apply.d.mts.map +1 -1
- package/dist/github/variables/apply.mjs +9 -6
- package/dist/github/variables/apply.mjs.map +1 -1
- package/package.json +41 -50
- package/src/cmd/repo-settings.mts +153 -0
- package/src/github/actions-settings/api/get-actions-settings.mts +38 -0
- package/src/github/actions-settings/api/index.mts +2 -0
- package/src/github/actions-settings/api/set-actions-settings.mts +39 -0
- package/src/github/actions-settings/apply.mts +63 -0
- package/src/github/actions-settings/backup.mts +36 -0
- package/src/github/actions-settings/constants.mts +50 -0
- package/src/github/actions-settings/index.mts +4 -0
- package/src/github/constants.mts +9 -42
- package/src/github/index.mts +4 -0
- package/src/github/octokit.mts +47 -3
- package/src/github/pages/api/get-pages-settings.mts +35 -0
- package/src/github/pages/api/index.mts +2 -0
- package/src/github/pages/api/set-pages-settings.mts +47 -0
- package/src/github/pages/apply.mts +73 -0
- package/src/github/pages/backup.mts +44 -0
- package/src/github/pages/constants.mts +16 -0
- package/src/github/pages/index.mts +4 -0
- package/src/github/repository/apply.mts +4 -7
- package/src/github/repository/backup.mts +2 -5
- package/src/github/repository/constants.mts +5 -1
- package/src/github/resolve-target-repo.mts +144 -0
- package/src/github/ruleset/api/get-all-rulesets.mts +3 -6
- package/src/github/ruleset/constants.mts +5 -1
- package/src/github/upgrade-stale-codec.mts +29 -0
- package/src/github/variables/apply.mts +9 -6
- package/dist/cmd/gh-apply-all.d.mts.map +0 -1
- package/dist/cmd/gh-apply-all.mjs +0 -10
- package/dist/cmd/gh-apply-all.mjs.map +0 -1
- package/dist/cmd/gh-backup-all.d.mts +0 -3
- package/dist/cmd/gh-backup-all.d.mts.map +0 -1
- package/dist/cmd/gh-backup-all.mjs +0 -9
- package/dist/cmd/gh-backup-all.mjs.map +0 -1
- package/src/cmd/gh-apply-all.mts +0 -18
- package/src/cmd/gh-backup-all.mts +0 -12
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type Type } from 'ts-fortress';
|
|
2
|
+
import { type StrictOmit } from 'ts-type-forge';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Restores the full ts-fortress `Type` interface for codecs imported from
|
|
6
|
+
* octokit-safe-types@1.2.19, whose declaration files were generated against
|
|
7
|
+
* ts-fortress 7 (whose `Type` lacked the `prune` member). The pnpm override in
|
|
8
|
+
* `pnpm-workspace.yaml` resolves ts-fortress >= 11 at runtime, so the codec
|
|
9
|
+
* object itself does have `prune`; only its declared type is stale. This
|
|
10
|
+
* verifies `prune` exists at runtime and rebuilds the codec with the correct
|
|
11
|
+
* type, without unsafe type assertions.
|
|
12
|
+
*
|
|
13
|
+
* TODO: Remove this helper once octokit-safe-types is rebuilt against
|
|
14
|
+
* ts-fortress >= 11.
|
|
15
|
+
*/
|
|
16
|
+
export const upgradeStaleCodec = <A,>(
|
|
17
|
+
codec: Readonly<{ defaultValue: A; prune?: Type<A>['prune'] }> &
|
|
18
|
+
StrictOmit<Type<A>, 'defaultValue' | 'prune'>,
|
|
19
|
+
): Type<A> => {
|
|
20
|
+
const { prune } = codec;
|
|
21
|
+
|
|
22
|
+
if (prune === undefined) {
|
|
23
|
+
throw new Error(
|
|
24
|
+
`The codec "${codec.typeName}" has no prune function at runtime. octokit-safe-types is probably resolving an old ts-fortress version; check the pnpm overrides.`,
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return { ...codec, prune };
|
|
29
|
+
};
|
|
@@ -10,16 +10,19 @@ import {
|
|
|
10
10
|
export const applyVariables = async (): Promise<void> => {
|
|
11
11
|
const variables = [
|
|
12
12
|
{
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
// noshiro-semantic-release-bot (App ID: 1442563)
|
|
14
|
+
name: 'SEMANTIC_RELEASE_BOT_CLIENT_ID',
|
|
15
|
+
value: 'Iv23liAmv2bgTYTkv2pt',
|
|
15
16
|
},
|
|
16
17
|
{
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
// noshiro-changesets-release-bot (App ID: 1576218)
|
|
19
|
+
name: 'CHANGESETS_RELEASE_BOT_CLIENT_ID',
|
|
20
|
+
value: 'Iv23limuZKrTEcXmN0lp',
|
|
19
21
|
},
|
|
20
22
|
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
// noshiro-repo-settings-bot (App ID: 4476573)
|
|
24
|
+
name: 'REPO_SETTINGS_BOT_CLIENT_ID',
|
|
25
|
+
value: 'Iv23ctr4Lq9H3wOYRQrD',
|
|
23
26
|
},
|
|
24
27
|
] as const;
|
|
25
28
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gh-apply-all.d.mts","sourceRoot":"","sources":["../../src/cmd/gh-apply-all.mts"],"names":[],"mappings":";AAEA,OAAO,eAAe,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import 'dotenv/config';
|
|
3
|
-
import { applyRepositorySettings, applyRulesets, applyVariables, } from '../github/index.mjs';
|
|
4
|
-
const runApplyAll = async () => {
|
|
5
|
-
await applyVariables();
|
|
6
|
-
await applyRulesets();
|
|
7
|
-
await applyRepositorySettings();
|
|
8
|
-
};
|
|
9
|
-
await runApplyAll();
|
|
10
|
-
//# sourceMappingURL=gh-apply-all.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gh-apply-all.mjs","sourceRoot":"","sources":["../../src/cmd/gh-apply-all.mts"],"names":[],"mappings":";AAEA,OAAO,eAAe,CAAC;AACvB,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,cAAc,GACf,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,GAAG,KAAK,IAAmB,EAAE;IAC5C,MAAM,cAAc,EAAE,CAAC;IAEvB,MAAM,aAAa,EAAE,CAAC;IAEtB,MAAM,uBAAuB,EAAE,CAAC;AAClC,CAAC,CAAC;AAEF,MAAM,WAAW,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gh-backup-all.d.mts","sourceRoot":"","sources":["../../src/cmd/gh-backup-all.mts"],"names":[],"mappings":";AAEA,OAAO,eAAe,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import 'dotenv/config';
|
|
3
|
-
import { backupRepositorySettings, backupRulesets } from '../github/index.mjs';
|
|
4
|
-
const runBackupAll = async () => {
|
|
5
|
-
await backupRulesets();
|
|
6
|
-
await backupRepositorySettings();
|
|
7
|
-
};
|
|
8
|
-
await runBackupAll();
|
|
9
|
-
//# sourceMappingURL=gh-backup-all.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gh-backup-all.mjs","sourceRoot":"","sources":["../../src/cmd/gh-backup-all.mts"],"names":[],"mappings":";AAEA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE/E,MAAM,YAAY,GAAG,KAAK,IAAmB,EAAE;IAC7C,MAAM,cAAc,EAAE,CAAC;IAEvB,MAAM,wBAAwB,EAAE,CAAC;AACnC,CAAC,CAAC;AAEF,MAAM,YAAY,EAAE,CAAC"}
|
package/src/cmd/gh-apply-all.mts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import 'dotenv/config';
|
|
4
|
-
import {
|
|
5
|
-
applyRepositorySettings,
|
|
6
|
-
applyRulesets,
|
|
7
|
-
applyVariables,
|
|
8
|
-
} from '../github/index.mjs';
|
|
9
|
-
|
|
10
|
-
const runApplyAll = async (): Promise<void> => {
|
|
11
|
-
await applyVariables();
|
|
12
|
-
|
|
13
|
-
await applyRulesets();
|
|
14
|
-
|
|
15
|
-
await applyRepositorySettings();
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
await runApplyAll();
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import 'dotenv/config';
|
|
4
|
-
import { backupRepositorySettings, backupRulesets } from '../github/index.mjs';
|
|
5
|
-
|
|
6
|
-
const runBackupAll = async (): Promise<void> => {
|
|
7
|
-
await backupRulesets();
|
|
8
|
-
|
|
9
|
-
await backupRepositorySettings();
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
await runBackupAll();
|