github-settings-as-code 3.0.2 → 3.2.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 +54 -34
- package/dist/cmd/repo-settings.mjs +13 -0
- package/dist/cmd/repo-settings.mjs.map +1 -1
- package/dist/github/actions-settings/api/get-actions-settings.d.mts +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 +4 -0
- package/dist/github/actions-settings/api/get-actions-settings.mjs.map +1 -1
- package/dist/github/actions-settings/api/set-actions-settings.d.mts.map +1 -1
- package/dist/github/actions-settings/api/set-actions-settings.mjs +8 -0
- package/dist/github/actions-settings/api/set-actions-settings.mjs.map +1 -1
- package/dist/github/actions-settings/constants.d.mts +67 -0
- package/dist/github/actions-settings/constants.d.mts.map +1 -1
- package/dist/github/actions-settings/constants.mjs +22 -0
- package/dist/github/actions-settings/constants.mjs.map +1 -1
- package/dist/github/constants.d.mts +2 -0
- package/dist/github/constants.d.mts.map +1 -1
- package/dist/github/constants.mjs +2 -0
- package/dist/github/constants.mjs.map +1 -1
- package/dist/github/environments/api/get-environments.d.mts +16 -0
- package/dist/github/environments/api/get-environments.d.mts.map +1 -0
- package/dist/github/environments/api/get-environments.mjs +98 -0
- package/dist/github/environments/api/get-environments.mjs.map +1 -0
- package/dist/github/environments/api/index.d.mts +3 -0
- package/dist/github/environments/api/index.d.mts.map +1 -0
- package/dist/github/environments/api/index.mjs +3 -0
- package/dist/github/environments/api/index.mjs.map +1 -0
- package/dist/github/environments/api/set-environment.d.mts +10 -0
- package/dist/github/environments/api/set-environment.d.mts.map +1 -0
- package/dist/github/environments/api/set-environment.mjs +73 -0
- package/dist/github/environments/api/set-environment.mjs.map +1 -0
- package/dist/github/environments/apply.d.mts +11 -0
- package/dist/github/environments/apply.d.mts.map +1 -0
- package/dist/github/environments/apply.mjs +67 -0
- package/dist/github/environments/apply.mjs.map +1 -0
- package/dist/github/environments/backup.d.mts +5 -0
- package/dist/github/environments/backup.d.mts.map +1 -0
- package/dist/github/environments/backup.mjs +24 -0
- package/dist/github/environments/backup.mjs.map +1 -0
- package/dist/github/environments/constants.d.mts +354 -0
- package/dist/github/environments/constants.d.mts.map +1 -0
- package/dist/github/environments/constants.mjs +62 -0
- package/dist/github/environments/constants.mjs.map +1 -0
- package/dist/github/environments/index.d.mts +6 -0
- package/dist/github/environments/index.d.mts.map +1 -0
- package/dist/github/environments/index.mjs +6 -0
- package/dist/github/environments/index.mjs.map +1 -0
- package/dist/github/environments/read-environment-contents.d.mts +4 -0
- package/dist/github/environments/read-environment-contents.d.mts.map +1 -0
- package/dist/github/environments/read-environment-contents.mjs +32 -0
- package/dist/github/environments/read-environment-contents.mjs.map +1 -0
- package/dist/github/index.d.mts +2 -0
- package/dist/github/index.d.mts.map +1 -1
- package/dist/github/index.mjs +2 -0
- package/dist/github/index.mjs.map +1 -1
- package/dist/github/vulnerability-alerts/api/get-vulnerability-alerts.d.mts +10 -0
- package/dist/github/vulnerability-alerts/api/get-vulnerability-alerts.d.mts.map +1 -0
- package/dist/github/vulnerability-alerts/api/get-vulnerability-alerts.mjs +25 -0
- package/dist/github/vulnerability-alerts/api/get-vulnerability-alerts.mjs.map +1 -0
- package/dist/github/vulnerability-alerts/api/index.d.mts +3 -0
- package/dist/github/vulnerability-alerts/api/index.d.mts.map +1 -0
- package/dist/github/vulnerability-alerts/api/index.mjs +3 -0
- package/dist/github/vulnerability-alerts/api/index.mjs.map +1 -0
- package/dist/github/vulnerability-alerts/api/set-vulnerability-alerts.d.mts +10 -0
- package/dist/github/vulnerability-alerts/api/set-vulnerability-alerts.d.mts.map +1 -0
- package/dist/github/vulnerability-alerts/api/set-vulnerability-alerts.mjs +19 -0
- package/dist/github/vulnerability-alerts/api/set-vulnerability-alerts.mjs.map +1 -0
- package/dist/github/vulnerability-alerts/apply.d.mts +11 -0
- package/dist/github/vulnerability-alerts/apply.d.mts.map +1 -0
- package/dist/github/vulnerability-alerts/apply.mjs +47 -0
- package/dist/github/vulnerability-alerts/apply.mjs.map +1 -0
- package/dist/github/vulnerability-alerts/backup.d.mts +5 -0
- package/dist/github/vulnerability-alerts/backup.d.mts.map +1 -0
- package/dist/github/vulnerability-alerts/backup.mjs +22 -0
- package/dist/github/vulnerability-alerts/backup.mjs.map +1 -0
- package/dist/github/vulnerability-alerts/constants.d.mts +72 -0
- package/dist/github/vulnerability-alerts/constants.d.mts.map +1 -0
- package/dist/github/vulnerability-alerts/constants.mjs +21 -0
- package/dist/github/vulnerability-alerts/constants.mjs.map +1 -0
- package/dist/github/vulnerability-alerts/index.d.mts +5 -0
- package/dist/github/vulnerability-alerts/index.d.mts.map +1 -0
- package/dist/github/vulnerability-alerts/index.mjs +5 -0
- package/dist/github/vulnerability-alerts/index.mjs.map +1 -0
- package/package.json +15 -15
- package/src/cmd/repo-settings.mts +17 -0
- package/src/github/actions-settings/api/get-actions-settings.mts +11 -1
- package/src/github/actions-settings/api/set-actions-settings.mts +13 -0
- package/src/github/actions-settings/constants.mts +24 -0
- package/src/github/constants.mts +7 -0
- package/src/github/environments/api/get-environments.mts +155 -0
- package/src/github/environments/api/index.mts +2 -0
- package/src/github/environments/api/set-environment.mts +106 -0
- package/src/github/environments/apply.mts +87 -0
- package/src/github/environments/backup.mts +38 -0
- package/src/github/environments/constants.mts +78 -0
- package/src/github/environments/index.mts +5 -0
- package/src/github/environments/read-environment-contents.mts +53 -0
- package/src/github/index.mts +2 -0
- package/src/github/vulnerability-alerts/api/get-vulnerability-alerts.mts +31 -0
- package/src/github/vulnerability-alerts/api/index.mts +2 -0
- package/src/github/vulnerability-alerts/api/set-vulnerability-alerts.mts +31 -0
- package/src/github/vulnerability-alerts/apply.mts +77 -0
- package/src/github/vulnerability-alerts/backup.mts +36 -0
- package/src/github/vulnerability-alerts/constants.mts +25 -0
- package/src/github/vulnerability-alerts/index.mts +4 -0
package/README.md
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
#
|
|
1
|
+
# GitHub Settings as Code
|
|
2
2
|
|
|
3
|
-
GitHub
|
|
3
|
+
A CLI for managing a GitHub repository's settings as JSON files.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The settings files are read from `repo-settings/` at the repository root.
|
|
6
6
|
|
|
7
|
-
> **v3.0.0
|
|
8
|
-
>
|
|
9
|
-
>
|
|
7
|
+
> **Breaking change in v3.0.0**: the settings directory moved from `github/` to
|
|
8
|
+
> `repo-settings/`. Migrate with `git mv github repo-settings`. The old name
|
|
9
|
+
> looked like an alias of `.github/` and suggested that workflows lived there
|
|
10
|
+
> too.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
npm install -D github-settings-as-code
|
|
16
|
+
```
|
|
10
17
|
|
|
11
18
|
## Usage
|
|
12
19
|
|
|
@@ -14,19 +21,19 @@ GitHub の repository 設定を JSON ファイルで管理するための CLI。
|
|
|
14
21
|
repo-settings <command> [target] [options]
|
|
15
22
|
```
|
|
16
23
|
|
|
17
|
-
| Command |
|
|
18
|
-
| -------- |
|
|
19
|
-
| `apply` |
|
|
20
|
-
| `backup` | GitHub
|
|
24
|
+
| Command | Description |
|
|
25
|
+
| -------- | ---------------------------------------------------------------- |
|
|
26
|
+
| `apply` | Apply the local settings files to GitHub |
|
|
27
|
+
| `backup` | Save the current values on GitHub to the local `bk/` directories |
|
|
21
28
|
|
|
22
|
-
| Target
|
|
23
|
-
|
|
|
24
|
-
| `all
|
|
25
|
-
| `repository`
|
|
26
|
-
| `rulesets`
|
|
27
|
-
| `variables`
|
|
28
|
-
| `actions`
|
|
29
|
-
| `pages`
|
|
29
|
+
| Target | Files | `apply` | `backup` |
|
|
30
|
+
| --------------- | ------------------------------------------------- | ------- | -------- |
|
|
31
|
+
| `all` (default) | All of the below | ✅ | ✅ |
|
|
32
|
+
| `repository` | `repo-settings/repository-settings/settings.json` | ✅ | ✅ |
|
|
33
|
+
| `rulesets` | `repo-settings/rulesets/*.json` | ✅ | ✅ |
|
|
34
|
+
| `variables` | Repository variables | ✅ | — |
|
|
35
|
+
| `actions` | `repo-settings/actions-settings/settings.json` | ✅ | ✅ |
|
|
36
|
+
| `pages` | `repo-settings/pages/settings.json` | ✅ | ✅ |
|
|
30
37
|
|
|
31
38
|
```sh
|
|
32
39
|
repo-settings apply
|
|
@@ -35,34 +42,47 @@ repo-settings backup
|
|
|
35
42
|
repo-settings apply --owner noshiro-pf --repo ts-repo-utils
|
|
36
43
|
```
|
|
37
44
|
|
|
38
|
-
|
|
45
|
+
Each `backup` is written to a `bk/` directory next to the settings file it
|
|
46
|
+
mirrors (for example `repo-settings/rulesets/bk/`). `apply` reads the values
|
|
47
|
+
back from GitHub afterwards and rewrites the local files with what was actually
|
|
48
|
+
applied.
|
|
49
|
+
|
|
50
|
+
## Resolving the target repository
|
|
39
51
|
|
|
40
|
-
|
|
52
|
+
The target is resolved in the following order. It is normally derived from
|
|
53
|
+
`git remote`, so neither option is usually needed.
|
|
41
54
|
|
|
42
|
-
1.
|
|
43
|
-
2.
|
|
55
|
+
1. The command-line options `--owner` / `--repo`
|
|
56
|
+
2. The environment variables `OWNER` / `REPO_NAME`
|
|
44
57
|
3. `git remote get-url origin`
|
|
45
|
-
4. `package.json`
|
|
58
|
+
4. The `name` field of `package.json` (repository name only)
|
|
59
|
+
|
|
60
|
+
## Authentication
|
|
46
61
|
|
|
47
|
-
|
|
62
|
+
The token is resolved in the following order. Locally, nothing needs to be
|
|
63
|
+
configured once you have run `gh auth login`.
|
|
48
64
|
|
|
49
|
-
|
|
65
|
+
1. The environment variables `GITHUB_APP_TOKEN` / `GH_TOKEN` /
|
|
66
|
+
`PERSONAL_ACCESS_TOKEN`
|
|
67
|
+
2. `gh auth token` (the gh CLI's login)
|
|
50
68
|
|
|
51
|
-
|
|
52
|
-
|
|
69
|
+
`GITHUB_TOKEN` is deliberately not read. In GitHub Actions it may hold the
|
|
70
|
+
default token, which lacks the Administration permission.
|
|
53
71
|
|
|
54
|
-
CI
|
|
55
|
-
|
|
56
|
-
|
|
72
|
+
In CI, pass a GitHub App installation token as `GH_TOKEN`. Changing repository
|
|
73
|
+
settings and rulesets requires the **Administration** permission, which the
|
|
74
|
+
default `GITHUB_TOKEN` cannot be granted (`administration` is not a valid key
|
|
75
|
+
under `permissions:`).
|
|
57
76
|
|
|
58
|
-
##
|
|
77
|
+
## Managed settings
|
|
59
78
|
|
|
60
|
-
|
|
|
79
|
+
| File | Location on GitHub |
|
|
61
80
|
| ------------------------------------------------- | --------------------------------------- |
|
|
62
81
|
| `repo-settings/repository-settings/settings.json` | Settings > General |
|
|
63
82
|
| `repo-settings/rulesets/*.json` | Settings > Rules > Rulesets |
|
|
64
83
|
| `repo-settings/actions-settings/settings.json` | Settings > Actions > General |
|
|
65
84
|
| `repo-settings/pages/settings.json` | Settings > Pages > Build and deployment |
|
|
66
85
|
|
|
67
|
-
`repo-settings/pages/settings.json
|
|
68
|
-
|
|
86
|
+
In a repository without `repo-settings/pages/settings.json`, Pages is left
|
|
87
|
+
untouched, so that a repository that does not use Pages never has it enabled by
|
|
88
|
+
mistake.
|
|
@@ -19,6 +19,9 @@ const HELP = dedent `
|
|
|
19
19
|
variables repository variables ( apply のみ )
|
|
20
20
|
actions repo-settings/actions-settings/settings.json
|
|
21
21
|
pages repo-settings/pages/settings.json
|
|
22
|
+
environments repo-settings/environments/*.json
|
|
23
|
+
vulnerability-alerts
|
|
24
|
+
repo-settings/vulnerability-alerts/settings.json
|
|
22
25
|
|
|
23
26
|
Options:
|
|
24
27
|
--owner <owner> 対象の owner
|
|
@@ -47,6 +50,8 @@ const TARGETS = [
|
|
|
47
50
|
'variables',
|
|
48
51
|
'actions',
|
|
49
52
|
'pages',
|
|
53
|
+
'environments',
|
|
54
|
+
'vulnerability-alerts',
|
|
50
55
|
];
|
|
51
56
|
const COMMAND_SET = new Set(COMMANDS);
|
|
52
57
|
const isCommand = (value) => COMMAND_SET.has(value);
|
|
@@ -93,12 +98,16 @@ const runners = {
|
|
|
93
98
|
await github.applyRepositorySettings();
|
|
94
99
|
await github.applyActionsSettings();
|
|
95
100
|
await github.applyPagesSettings();
|
|
101
|
+
await github.applyEnvironments();
|
|
102
|
+
await github.applyVulnerabilityAlerts();
|
|
96
103
|
},
|
|
97
104
|
repository: github.applyRepositorySettings,
|
|
98
105
|
rulesets: github.applyRulesets,
|
|
99
106
|
variables: github.applyVariables,
|
|
100
107
|
actions: github.applyActionsSettings,
|
|
101
108
|
pages: github.applyPagesSettings,
|
|
109
|
+
environments: github.applyEnvironments,
|
|
110
|
+
'vulnerability-alerts': github.applyVulnerabilityAlerts,
|
|
102
111
|
},
|
|
103
112
|
backup: {
|
|
104
113
|
all: async () => {
|
|
@@ -106,11 +115,15 @@ const runners = {
|
|
|
106
115
|
await github.backupRepositorySettings();
|
|
107
116
|
await github.backupActionsSettings();
|
|
108
117
|
await github.backupPagesSettings();
|
|
118
|
+
await github.backupEnvironments();
|
|
119
|
+
await github.backupVulnerabilityAlerts();
|
|
109
120
|
},
|
|
110
121
|
repository: github.backupRepositorySettings,
|
|
111
122
|
rulesets: github.backupRulesets,
|
|
112
123
|
actions: github.backupActionsSettings,
|
|
113
124
|
pages: github.backupPagesSettings,
|
|
125
|
+
environments: github.backupEnvironments,
|
|
126
|
+
'vulnerability-alerts': github.backupVulnerabilityAlerts,
|
|
114
127
|
},
|
|
115
128
|
};
|
|
116
129
|
const runner = runners[commandArg][targetArg];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo-settings.mjs","sourceRoot":"","sources":["../../src/cmd/repo-settings.mts"],"names":[],"mappings":";AAEA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,eAAe,CAAC;AACvB,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAGpC,MAAM,IAAI,GAAG,MAAM,CAAA
|
|
1
|
+
{"version":3,"file":"repo-sett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kC,SAAS,GAAG,CAAC,CAAC;AACrE,CAAC;AAED,MAAM,MAAM,EAAE,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { ActionsSettings } from '../constants.mjs';
|
|
|
2
2
|
/**
|
|
3
3
|
* Settings > Actions > General の現在値を取得する。
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* 3 つのエンドポイントの結果を 1 つのオブジェクトにまとめる。
|
|
6
6
|
*/
|
|
7
7
|
export declare const getActionsSettings: () => Promise<ActionsSettings>;
|
|
8
8
|
//# sourceMappingURL=get-actions-settings.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-actions-settings.d.mts","sourceRoot":"","sources":["../../../../src/github/actions-settings/api/get-actions-settings.mts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,QAAa,OAAO,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"get-actions-settings.d.mts","sourceRoot":"","sources":["../../../../src/github/actions-settings/api/get-actions-settings.mts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,QAAa,OAAO,CAAC,eAAe,CA6BlE,CAAC"}
|
|
@@ -10,11 +10,15 @@ export const getActionsSettings = async () => {
|
|
|
10
10
|
|
|
11
11
|
const permissions = await octokit.request('GET /repos/{owner}/{repo}/actions/permissions', { owner: OWNER, repo: REPO, headers: octokitHeaders });
|
|
12
12
|
|
|
13
|
+
const workflowPermissions = await octokit.request('GET /repos/{owner}/{repo}/actions/permissions/workflow', { owner: OWNER, repo: REPO, headers: octokitHeaders });
|
|
14
|
+
|
|
13
15
|
const forkPrApproval = await octokit.request('GET /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval', { owner: OWNER, repo: REPO, headers: octokitHeaders });
|
|
14
16
|
return ActionsSettings.fill({
|
|
15
17
|
enabled: permissions.data.enabled,
|
|
16
18
|
allowed_actions: permissions.data.allowed_actions,
|
|
17
19
|
sha_pinning_required: permissions.data.sha_pinning_required,
|
|
20
|
+
default_workflow_permissions: workflowPermissions.data.default_workflow_permissions,
|
|
21
|
+
can_approve_pull_request_reviews: workflowPermissions.data.can_approve_pull_request_reviews,
|
|
18
22
|
fork_pr_contributor_approval_policy: forkPrApproval.data.approval_policy,
|
|
19
23
|
});
|
|
20
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-actions-settings.mjs","sourceRoot":"","sources":["../../../../src/github/actions-settings/api/get-actions-settings.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,IAA8B,EAAE;IACrE,mGAAmG;IACnG,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,OAAO,CACvC,+CAAsE,EACtE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,CACtD,CAAC;IAEF,iHAAiH;IACjH,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,OAAO,CAC1C,4EAAmG,EACnG,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,CACtD,CAAC;IAEF,OAAO,eAAe,CAAC,IAAI,CAAC;QAC1B,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,OAAO;QACjC,eAAe,EAAE,WAAW,CAAC,IAAI,CAAC,eAAe;QACjD,oBAAoB,EAAE,WAAW,CAAC,IAAI,CAAC,oBAAoB;QAC3D,mCAAmC,EAAE,cAAc,CAAC,IAAI,CAAC,eAAe;KACzE,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"get-actions-settings.mjs","sourceRoot":"","sources":["../../../../src/github/actions-settings/api/get-actions-settings.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,IAA8B,EAAE;IACrE,mGAAmG;IACnG,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,OAAO,CACvC,+CAAsE,EACtE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,CACtD,CAAC;IAEF,qGAAqG;IACrG,MAAM,mBAAmB,GAAG,MAAM,OAAO,CAAC,OAAO,CAC/C,wDAA+E,EAC/E,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,CACtD,CAAC;IAEF,iHAAiH;IACjH,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,OAAO,CAC1C,4EAAmG,EACnG,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,CACtD,CAAC;IAEF,OAAO,eAAe,CAAC,IAAI,CAAC;QAC1B,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,OAAO;QACjC,eAAe,EAAE,WAAW,CAAC,IAAI,CAAC,eAAe;QACjD,oBAAoB,EAAE,WAAW,CAAC,IAAI,CAAC,oBAAoB;QAC3D,4BAA4B,EAC1B,mBAAmB,CAAC,IAAI,CAAC,4BAA4B;QACvD,gCAAgC,EAC9B,mBAAmB,CAAC,IAAI,CAAC,gCAAgC;QAC3D,mCAAmC,EAAE,cAAc,CAAC,IAAI,CAAC,eAAe;KACzE,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-actions-settings.d.mts","sourceRoot":"","sources":["../../../../src/github/actions-settings/api/set-actions-settings.mts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,oDAAoD;AACpD,eAAO,MAAM,kBAAkB,aACnB,eAAe,KACxB,OAAO,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"set-actions-settings.d.mts","sourceRoot":"","sources":["../../../../src/github/actions-settings/api/set-actions-settings.mts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,oDAAoD;AACpD,eAAO,MAAM,kBAAkB,aACnB,eAAe,KACxB,OAAO,CAAC,IAAI,CA2Cd,CAAC"}
|
|
@@ -17,6 +17,14 @@ export const setActionsSettings = async (settings) => {
|
|
|
17
17
|
};
|
|
18
18
|
await octokit.request('PUT /repos/{owner}/{repo}/actions/permissions', permissionsParams);
|
|
19
19
|
|
|
20
|
+
await octokit.request('PUT /repos/{owner}/{repo}/actions/permissions/workflow', {
|
|
21
|
+
owner: OWNER,
|
|
22
|
+
repo: REPO,
|
|
23
|
+
headers: octokitHeaders,
|
|
24
|
+
default_workflow_permissions: settings.default_workflow_permissions,
|
|
25
|
+
can_approve_pull_request_reviews: settings.can_approve_pull_request_reviews,
|
|
26
|
+
});
|
|
27
|
+
|
|
20
28
|
await octokit.request('PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval', {
|
|
21
29
|
owner: OWNER,
|
|
22
30
|
repo: REPO,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-actions-settings.mjs","sourceRoot":"","sources":["../../../../src/github/actions-settings/api/set-actions-settings.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,oDAAoD;AACpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EACrC,QAAyB,EACV,EAAE;IACjB,mGAAmG;IACnG,EAAE;IACF,mEAAmE;IACnE,yCAAyC;IACzC,oDAAoD;IACpD,MAAM,iBAAiB,GAAG;QACxB,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,cAAc;QACvB,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,eAAe,EAAE,QAAQ,CAAC,eAAe;QACzC,oBAAoB,EAAE,QAAQ,CAAC,oBAAoB;KAC3C,CAAC;IAEX,MAAM,OAAO,CAAC,OAAO,CACnB,+CAAsE,EACtE,iBAAiB,CAClB,CAAC;IAEF,iHAAiH;IACjH,MAAM,OAAO,CAAC,OAAO,CACnB,4EAAmG,EACnG;QACE,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,cAAc;QACvB,eAAe,EAAE,QAAQ,CAAC,mCAAmC;KAC9D,CACF,CAAC;AACJ,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"set-actions-settings.mjs","sourceRoot":"","sources":["../../../../src/github/actions-settings/api/set-actions-settings.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,oDAAoD;AACpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EACrC,QAAyB,EACV,EAAE;IACjB,mGAAmG;IACnG,EAAE;IACF,mEAAmE;IACnE,yCAAyC;IACzC,oDAAoD;IACpD,MAAM,iBAAiB,GAAG;QACxB,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,cAAc;QACvB,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,eAAe,EAAE,QAAQ,CAAC,eAAe;QACzC,oBAAoB,EAAE,QAAQ,CAAC,oBAAoB;KAC3C,CAAC;IAEX,MAAM,OAAO,CAAC,OAAO,CACnB,+CAAsE,EACtE,iBAAiB,CAClB,CAAC;IAEF,qGAAqG;IACrG,MAAM,OAAO,CAAC,OAAO,CACnB,wDAA+E,EAC/E;QACE,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,cAAc;QACvB,4BAA4B,EAAE,QAAQ,CAAC,4BAA4B;QACnE,gCAAgC,EAC9B,QAAQ,CAAC,gCAAgC;KAC5C,CACF,CAAC;IAEF,iHAAiH;IACjH,MAAM,OAAO,CAAC,OAAO,CACnB,4EAAmG,EACnG;QACE,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,cAAc;QACvB,eAAe,EAAE,QAAQ,CAAC,mCAAmC;KAC9D,CACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -6,53 +6,70 @@ import * as t from 'ts-fortress';
|
|
|
6
6
|
* 管理する:
|
|
7
7
|
*
|
|
8
8
|
* - `GET|PUT /repos/{owner}/{repo}/actions/permissions`
|
|
9
|
+
* - `GET|PUT /repos/{owner}/{repo}/actions/permissions/workflow`
|
|
9
10
|
* - `GET|PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval`
|
|
10
11
|
*/
|
|
11
12
|
export declare const ActionsSettings: Readonly<{
|
|
12
13
|
typeName: string;
|
|
13
14
|
defaultValue: Readonly<{
|
|
14
15
|
allowed_actions: "all" | "local_only" | "selected";
|
|
16
|
+
can_approve_pull_request_reviews: boolean;
|
|
17
|
+
default_workflow_permissions: "read" | "write";
|
|
15
18
|
enabled: boolean;
|
|
16
19
|
fork_pr_contributor_approval_policy: "all_external_contributors" | "first_time_contributors" | "first_time_contributors_new_to_github";
|
|
17
20
|
sha_pinning_required: boolean;
|
|
18
21
|
}>;
|
|
19
22
|
is: (a: unknown) => a is Readonly<{
|
|
20
23
|
allowed_actions: "all" | "local_only" | "selected";
|
|
24
|
+
can_approve_pull_request_reviews: boolean;
|
|
25
|
+
default_workflow_permissions: "read" | "write";
|
|
21
26
|
enabled: boolean;
|
|
22
27
|
fork_pr_contributor_approval_policy: "all_external_contributors" | "first_time_contributors" | "first_time_contributors_new_to_github";
|
|
23
28
|
sha_pinning_required: boolean;
|
|
24
29
|
}>;
|
|
25
30
|
assertIs: (a: unknown) => asserts a is Readonly<{
|
|
26
31
|
allowed_actions: "all" | "local_only" | "selected";
|
|
32
|
+
can_approve_pull_request_reviews: boolean;
|
|
33
|
+
default_workflow_permissions: "read" | "write";
|
|
27
34
|
enabled: boolean;
|
|
28
35
|
fork_pr_contributor_approval_policy: "all_external_contributors" | "first_time_contributors" | "first_time_contributors_new_to_github";
|
|
29
36
|
sha_pinning_required: boolean;
|
|
30
37
|
}>;
|
|
31
38
|
cast: (a: unknown) => Readonly<{
|
|
32
39
|
allowed_actions: "all" | "local_only" | "selected";
|
|
40
|
+
can_approve_pull_request_reviews: boolean;
|
|
41
|
+
default_workflow_permissions: "read" | "write";
|
|
33
42
|
enabled: boolean;
|
|
34
43
|
fork_pr_contributor_approval_policy: "all_external_contributors" | "first_time_contributors" | "first_time_contributors_new_to_github";
|
|
35
44
|
sha_pinning_required: boolean;
|
|
36
45
|
}>;
|
|
37
46
|
fill: (a: unknown) => Readonly<{
|
|
38
47
|
allowed_actions: "all" | "local_only" | "selected";
|
|
48
|
+
can_approve_pull_request_reviews: boolean;
|
|
49
|
+
default_workflow_permissions: "read" | "write";
|
|
39
50
|
enabled: boolean;
|
|
40
51
|
fork_pr_contributor_approval_policy: "all_external_contributors" | "first_time_contributors" | "first_time_contributors_new_to_github";
|
|
41
52
|
sha_pinning_required: boolean;
|
|
42
53
|
}>;
|
|
43
54
|
prune: <B extends Readonly<{
|
|
44
55
|
allowed_actions: "all" | "local_only" | "selected";
|
|
56
|
+
can_approve_pull_request_reviews: boolean;
|
|
57
|
+
default_workflow_permissions: "read" | "write";
|
|
45
58
|
enabled: boolean;
|
|
46
59
|
fork_pr_contributor_approval_policy: "all_external_contributors" | "first_time_contributors" | "first_time_contributors_new_to_github";
|
|
47
60
|
sha_pinning_required: boolean;
|
|
48
61
|
}>>(a: B) => Readonly<{
|
|
49
62
|
allowed_actions: "all" | "local_only" | "selected";
|
|
63
|
+
can_approve_pull_request_reviews: boolean;
|
|
64
|
+
default_workflow_permissions: "read" | "write";
|
|
50
65
|
enabled: boolean;
|
|
51
66
|
fork_pr_contributor_approval_policy: "all_external_contributors" | "first_time_contributors" | "first_time_contributors_new_to_github";
|
|
52
67
|
sha_pinning_required: boolean;
|
|
53
68
|
}>;
|
|
54
69
|
validate: (a: unknown) => t.Result<Readonly<{
|
|
55
70
|
allowed_actions: "all" | "local_only" | "selected";
|
|
71
|
+
can_approve_pull_request_reviews: boolean;
|
|
72
|
+
default_workflow_permissions: "read" | "write";
|
|
56
73
|
enabled: boolean;
|
|
57
74
|
fork_pr_contributor_approval_policy: "all_external_contributors" | "first_time_contributors" | "first_time_contributors_new_to_github";
|
|
58
75
|
sha_pinning_required: boolean;
|
|
@@ -125,6 +142,56 @@ export declare const ActionsSettings: Readonly<{
|
|
|
125
142
|
}>[]>;
|
|
126
143
|
optional?: true;
|
|
127
144
|
}>;
|
|
145
|
+
/**
|
|
146
|
+
* 「 Workflow permissions 」。 job が `permissions` を宣言しなかったときに
|
|
147
|
+
* `GITHUB_TOKEN` が受け取る既定値。
|
|
148
|
+
*
|
|
149
|
+
* `read` にできるのは、 workflow 側が全て明示的に `permissions` を宣言して
|
|
150
|
+
* いる場合だけ。宣言の無い job はこの既定値をそのまま受け取るため、
|
|
151
|
+
* `write` のままだと「 branch の中身が何であれ書き込めるトークン」が
|
|
152
|
+
* 渡る。 .github/workflows/type-check.yml 冒頭の注記を参照。
|
|
153
|
+
*/
|
|
154
|
+
readonly default_workflow_permissions: Readonly<{
|
|
155
|
+
typeName: string;
|
|
156
|
+
defaultValue: "read" | "write";
|
|
157
|
+
is: (a: unknown) => a is "read" | "write";
|
|
158
|
+
assertIs: (a: unknown) => asserts a is "read" | "write";
|
|
159
|
+
cast: (a: unknown) => "read" | "write";
|
|
160
|
+
fill: (a: unknown) => "read" | "write";
|
|
161
|
+
prune: <B extends "read" | "write">(a: B) => "read" | "write";
|
|
162
|
+
validate: (a: unknown) => t.Result<"read" | "write", readonly Readonly<{
|
|
163
|
+
path: readonly string[];
|
|
164
|
+
actualValue: unknown;
|
|
165
|
+
expectedType: string;
|
|
166
|
+
typeName: string;
|
|
167
|
+
details?: t.ValidationErrorDetails | undefined;
|
|
168
|
+
}>[]>;
|
|
169
|
+
optional?: true;
|
|
170
|
+
}>;
|
|
171
|
+
/**
|
|
172
|
+
* 「 Allow GitHub Actions to create and approve pull requests 」。
|
|
173
|
+
*
|
|
174
|
+
* `main` の ruleset は `required_approving_review_count` が 0 なので
|
|
175
|
+
* 承認そのものは merge 条件ではないが、 Actions に PR を作らせる必要が
|
|
176
|
+
* あるのは App token を使う workflow だけで、 `GITHUB_TOKEN` には要らない。
|
|
177
|
+
*/
|
|
178
|
+
readonly can_approve_pull_request_reviews: Readonly<{
|
|
179
|
+
typeName: string;
|
|
180
|
+
defaultValue: boolean;
|
|
181
|
+
is: (a: unknown) => a is boolean;
|
|
182
|
+
assertIs: (a: unknown) => asserts a is boolean;
|
|
183
|
+
cast: (a: unknown) => boolean;
|
|
184
|
+
fill: (a: unknown) => boolean;
|
|
185
|
+
prune: <B extends boolean>(a: B) => boolean;
|
|
186
|
+
validate: (a: unknown) => t.Result<boolean, readonly Readonly<{
|
|
187
|
+
path: readonly string[];
|
|
188
|
+
actualValue: unknown;
|
|
189
|
+
expectedType: string;
|
|
190
|
+
typeName: string;
|
|
191
|
+
details?: t.ValidationErrorDetails | undefined;
|
|
192
|
+
}>[]>;
|
|
193
|
+
optional?: true;
|
|
194
|
+
}>;
|
|
128
195
|
/**
|
|
129
196
|
* 「 Approval for running fork pull request workflows from contributors 」。
|
|
130
197
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../../../src/github/actions-settings/constants.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AAEjC
|
|
1
|
+
{"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../../../src/github/actions-settings/constants.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AAEjC;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAC1B,4DAA4D;;;;;;;;;;;;;;;;;;QAG5D,+CAA+C;;;;;;;;;;;;;;;;;;QAM/C;;;;;WAKG;;;;;;;;;;;;;;;;;;QAGH;;;;;;;;WAQG;;;;;;;;;;;;;;;;;;QAMH;;;;;;WAMG;;;;;;;;;;;;;;;;;;QAGH;;;;;;WAMG;;;;;;;;;;;;;;;;;;;EAYH,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -8,6 +8,7 @@ import * as t from 'ts-fortress';
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
|
|
11
12
|
export const ActionsSettings = t.record({
|
|
12
13
|
|
|
13
14
|
enabled: t.boolean(true),
|
|
@@ -30,6 +31,27 @@ export const ActionsSettings = t.record({
|
|
|
30
31
|
|
|
31
32
|
|
|
32
33
|
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
default_workflow_permissions: t.enumType(['read', 'write'], {
|
|
37
|
+
typeName: 'DefaultWorkflowPermissions',
|
|
38
|
+
defaultValue: 'read',
|
|
39
|
+
}),
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
can_approve_pull_request_reviews: t.boolean(false),
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
33
55
|
fork_pr_contributor_approval_policy: t.enumType([
|
|
34
56
|
'first_time_contributors_new_to_github',
|
|
35
57
|
'first_time_contributors',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../../../src/github/actions-settings/constants.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AAEjC
|
|
1
|
+
{"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../../../src/github/actions-settings/constants.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AAEjC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,4DAA4D;IAC5D,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IAExB,+CAA+C;IAC/C,eAAe,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE;QAC7D,QAAQ,EAAE,gBAAgB;QAC1B,YAAY,EAAE,KAAK;KACpB,CAAC;IAEF;;;;;OAKG;IACH,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IAEtC;;;;;;;;OAQG;IACH,4BAA4B,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;QAC1D,QAAQ,EAAE,4BAA4B;QACtC,YAAY,EAAE,MAAM;KACrB,CAAC;IAEF;;;;;;OAMG;IACH,gCAAgC,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IAElD;;;;;;OAMG;IACH,mCAAmC,EAAE,CAAC,CAAC,QAAQ,CAC7C;QACE,uCAAuC;QACvC,yBAAyB;QACzB,2BAA2B;KAC5B,EACD;QACE,QAAQ,EAAE,iCAAiC;QAC3C,YAAY,EAAE,2BAA2B;KAC1C,CACF;CACF,CAAC,CAAC"}
|
|
@@ -4,6 +4,8 @@ export declare const settingsJsonName = "settings.json";
|
|
|
4
4
|
export declare const repositorySettingsDir: string;
|
|
5
5
|
export declare const actionsSettingsDir: string;
|
|
6
6
|
export declare const pagesSettingsDir: string;
|
|
7
|
+
export declare const environmentsDir: string;
|
|
8
|
+
export declare const vulnerabilityAlertsDir: string;
|
|
7
9
|
export declare const rulesetsDir: string;
|
|
8
10
|
export declare const octokitHeaders: {
|
|
9
11
|
readonly 'X-GitHub-Api-Version': '2022-11-28';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../../src/github/constants.mts"],"names":[],"mappings":"AAKA,eAAO,MAAM,KAAK,EAAE,MAAyB,CAAC;AAE9C,eAAO,MAAM,IAAI,EAAE,MAAwB,CAAC;AAM5C,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAEhD,eAAO,MAAM,qBAAqB,QAGjC,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAG9B,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAuC,CAAC;AAErE,eAAO,MAAM,WAAW,QAA0C,CAAC;AAEnE,eAAO,MAAM,cAAc;aACzB,sBAAsB,EAAE,YAAY;CAC5B,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../../src/github/constants.mts"],"names":[],"mappings":"AAKA,eAAO,MAAM,KAAK,EAAE,MAAyB,CAAC;AAE9C,eAAO,MAAM,IAAI,EAAE,MAAwB,CAAC;AAM5C,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAEhD,eAAO,MAAM,qBAAqB,QAGjC,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAG9B,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAuC,CAAC;AAErE,eAAO,MAAM,eAAe,QAA8C,CAAC;AAE3E,eAAO,MAAM,sBAAsB,QAGlC,CAAC;AAEF,eAAO,MAAM,WAAW,QAA0C,CAAC;AAEnE,eAAO,MAAM,cAAc;aACzB,sBAAsB,EAAE,YAAY;CAC5B,CAAC"}
|
|
@@ -10,6 +10,8 @@ export const settingsJsonName = 'settings.json';
|
|
|
10
10
|
export const repositorySettingsDir = path.resolve(settingsDir, './repository-settings');
|
|
11
11
|
export const actionsSettingsDir = path.resolve(settingsDir, './actions-settings');
|
|
12
12
|
export const pagesSettingsDir = path.resolve(settingsDir, './pages');
|
|
13
|
+
export const environmentsDir = path.resolve(settingsDir, './environments');
|
|
14
|
+
export const vulnerabilityAlertsDir = path.resolve(settingsDir, './vulnerability-alerts');
|
|
13
15
|
export const rulesetsDir = path.resolve(settingsDir, './rulesets');
|
|
14
16
|
export const octokitHeaders = {
|
|
15
17
|
'X-GitHub-Api-Version': '2022-11-28',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../../src/github/constants.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,MAAM,UAAU,GAAG,MAAM,iBAAiB,EAAE,CAAC;AAE7C,MAAM,CAAC,MAAM,KAAK,GAAW,UAAU,CAAC,KAAK,CAAC;AAE9C,MAAM,CAAC,MAAM,IAAI,GAAW,UAAU,CAAC,IAAI,CAAC;AAE5C,yEAAyE;AACzE,iEAAiE;AACjE,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,iBAAiB,CAAC,CAAC;AAEnE,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAEhD,MAAM,CAAC,MAAM,qBAAqB,GAAG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,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;AAE3E,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC,OAAO,CAChD,WAAW,EACX,wBAAwB,CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;AAEnE,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,sBAAsB,EAAE,YAAY;CAC5B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EnvironmentSettings } from '../constants.mjs';
|
|
2
|
+
/**
|
|
3
|
+
* Settings > Environments の現在値を、宣言ファイルと同じ形にして返す。
|
|
4
|
+
*
|
|
5
|
+
* 名前順に整える。 GitHub が返す順は作成順で、環境を 1 つ足しただけで
|
|
6
|
+
* `bk/` の中身が並び替わると差分が読めなくなるため。
|
|
7
|
+
*/
|
|
8
|
+
export declare const getAllEnvironments: () => Promise<readonly EnvironmentSettings[]>;
|
|
9
|
+
/** 「 Selected branches and tags 」に登録されている pattern を列挙する。 */
|
|
10
|
+
export declare const getDeploymentBranchPolicies: (environmentName: string) => Promise<readonly DeploymentBranchPolicy[]>;
|
|
11
|
+
export type DeploymentBranchPolicy = Readonly<{
|
|
12
|
+
id: number;
|
|
13
|
+
name: string;
|
|
14
|
+
type: 'branch' | 'tag';
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=get-environments.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-environments.d.mts","sourceRoot":"","sources":["../../../../src/github/environments/api/get-environments.mts"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,QAAa,OAAO,CACjD,SAAS,mBAAmB,EAAE,CAoC/B,CAAC;AAWF,4DAA4D;AAC5D,eAAO,MAAM,2BAA2B,oBACrB,MAAM,KACtB,OAAO,CAAC,SAAS,sBAAsB,EAAE,CAkB3C,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,GAAG,KAAK,CAAC;CACxB,CAAC,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { Arr } from 'ts-data-forge';
|
|
2
|
+
import * as t from 'ts-fortress';
|
|
3
|
+
import { Result } from 'ts-repo-utils';
|
|
4
|
+
import { octokitHeaders, OWNER, REPO } from '../../constants.mjs';
|
|
5
|
+
import { octokit } from '../../octokit.mjs';
|
|
6
|
+
import { EnvironmentSettings } from '../constants.mjs';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export const getAllEnvironments = async () => {
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
const response = await octokit.request('GET /repos/{owner}/{repo}/environments', { owner: OWNER, repo: REPO, headers: octokitHeaders, per_page: 100 });
|
|
19
|
+
const environments = response.data.environments ?? [];
|
|
20
|
+
const settings = await Promise.all(environments.map(async (environment) => {
|
|
21
|
+
const policy = environment.deployment_branch_policy ?? undefined;
|
|
22
|
+
return EnvironmentSettings.fill({
|
|
23
|
+
name: environment.name,
|
|
24
|
+
...parseProtectionRules(environment.protection_rules),
|
|
25
|
+
deployment_branch_policy: policy === undefined
|
|
26
|
+
? null
|
|
27
|
+
: {
|
|
28
|
+
protected_branches: policy.protected_branches,
|
|
29
|
+
custom_branch_policies: policy.custom_branch_policies,
|
|
30
|
+
},
|
|
31
|
+
deployment_branch_policies: policy?.custom_branch_policies === true
|
|
32
|
+
? await getDeploymentBranchPolicyNames(environment.name)
|
|
33
|
+
: [],
|
|
34
|
+
});
|
|
35
|
+
}));
|
|
36
|
+
return settings.toSorted((a, b) => a.name.localeCompare(b.name));
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const getDeploymentBranchPolicyNames = async (environmentName) => {
|
|
40
|
+
const policies = await getDeploymentBranchPolicies(environmentName);
|
|
41
|
+
return policies.map(({ name, type }) => ({ name, type }));
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const getDeploymentBranchPolicies = async (environmentName) => {
|
|
45
|
+
|
|
46
|
+
const response = await octokit.request('GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies', {
|
|
47
|
+
owner: OWNER,
|
|
48
|
+
repo: REPO,
|
|
49
|
+
environment_name: environmentName,
|
|
50
|
+
headers: octokitHeaders,
|
|
51
|
+
per_page: 100,
|
|
52
|
+
});
|
|
53
|
+
return response.data.branch_policies.map((policy) => ({
|
|
54
|
+
id: policy.id ?? 0,
|
|
55
|
+
name: policy.name ?? '',
|
|
56
|
+
type: policy.type === 'tag' ? 'tag' : 'branch',
|
|
57
|
+
}));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
const parseProtectionRules = (protectionRules) => {
|
|
68
|
+
const validationResult = ProtectionRules.validate(protectionRules ?? []);
|
|
69
|
+
if (Result.isErr(validationResult)) {
|
|
70
|
+
throw new Error(Arr.toUnshifted('GitHub が返した environment の protection_rules を読めませんでした。')(t.validationErrorsToMessages(validationResult.value)).join('\n'));
|
|
71
|
+
}
|
|
72
|
+
const rules = validationResult.value;
|
|
73
|
+
const waitTimer = rules.find((rule) => rule.type === 'wait_timer');
|
|
74
|
+
const requiredReviewers = rules.find((rule) => rule.type === 'required_reviewers');
|
|
75
|
+
return {
|
|
76
|
+
wait_timer: waitTimer?.wait_timer ?? 0,
|
|
77
|
+
prevent_self_review: requiredReviewers?.prevent_self_review ?? false,
|
|
78
|
+
reviewers: (requiredReviewers?.reviewers ?? []).map((entry) => ({
|
|
79
|
+
type: entry.type,
|
|
80
|
+
id: entry.reviewer.id,
|
|
81
|
+
})),
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
const ProtectionRules = t.array(t.record({
|
|
85
|
+
type: t.string(''),
|
|
86
|
+
wait_timer: t.optional(t.number(0)),
|
|
87
|
+
prevent_self_review: t.optional(t.boolean(false)),
|
|
88
|
+
reviewers: t.optional(t.array(t.record({
|
|
89
|
+
type: t.enumType(['User', 'Team'], {
|
|
90
|
+
typeName: 'EnvironmentReviewerType',
|
|
91
|
+
defaultValue: 'User',
|
|
92
|
+
}),
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
reviewer: t.record({ id: t.number(0) }),
|
|
96
|
+
}))),
|
|
97
|
+
}), { typeName: 'EnvironmentProtectionRules' });
|
|
98
|
+
//# sourceMappingURL=get-environments.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-environments.mjs","sourceRoot":"","sources":["../../../../src/github/environments/api/get-environments.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,IAErC,EAAE;IACF,0EAA0E;IAC1E,EAAE;IACF,uCAAuC;IACvC,wCAAwC;IACxC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,OAAO,CACpC,wCAA+D,EAC/D,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EA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E,QAAQ,EAAE,4BAA4B,EAAE,CAC3C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/github/environments/api/index.mts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../src/github/environments/api/index.mts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC"}
|