github-settings-as-code 4.0.0 → 4.0.2
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.
|
@@ -149,7 +149,7 @@ export declare const ActionsSettings: Readonly<{
|
|
|
149
149
|
* `read` にできるのは、 workflow 側が全て明示的に `permissions` を宣言して
|
|
150
150
|
* いる場合だけ。宣言の無い job はこの既定値をそのまま受け取るため、
|
|
151
151
|
* `write` のままだと「 branch の中身が何であれ書き込めるトークン」が
|
|
152
|
-
* 渡る。 .github/workflows/
|
|
152
|
+
* 渡る。 .github/workflows/README.md の "Permissions" を参照。
|
|
153
153
|
*/
|
|
154
154
|
readonly default_workflow_permissions: Readonly<{
|
|
155
155
|
typeName: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "github-settings-as-code",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"keywords": [
|
|
6
6
|
"github",
|
|
@@ -27,39 +27,39 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@octokit/core": "^7.0.8",
|
|
29
29
|
"dedent": "^1.7.2",
|
|
30
|
-
"dotenv": "^
|
|
30
|
+
"dotenv": "^18.0.4",
|
|
31
31
|
"octokit-safe-types": "^1.2.28",
|
|
32
32
|
"ts-data-forge": "^14.7.1",
|
|
33
33
|
"ts-fortress": "^12.1.3",
|
|
34
|
-
"ts-repo-utils": "^10.7.
|
|
34
|
+
"ts-repo-utils": "^10.7.1",
|
|
35
35
|
"ts-type-forge": "^9.2.2"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@types/node": "26.
|
|
39
|
-
"@vitest/coverage-v8": "5.0.
|
|
40
|
-
"@vitest/ui": "5.0.
|
|
41
|
-
"cspell": "10.3.
|
|
42
|
-
"eslint": "10.
|
|
43
|
-
"eslint-config-typed": "5.
|
|
44
|
-
"eslint-plugin-ts-data-forge": "0.8.
|
|
45
|
-
"eslint-plugin-ts-fortress": "1.2.
|
|
46
|
-
"eslint-plugin-ts-type-forge": "0.8.
|
|
38
|
+
"@types/node": "26.6.3",
|
|
39
|
+
"@vitest/coverage-v8": "5.0.2",
|
|
40
|
+
"@vitest/ui": "5.0.2",
|
|
41
|
+
"cspell": "10.3.5",
|
|
42
|
+
"eslint": "10.11.0",
|
|
43
|
+
"eslint-config-typed": "5.16.0",
|
|
44
|
+
"eslint-plugin-ts-data-forge": "0.8.2",
|
|
45
|
+
"eslint-plugin-ts-fortress": "1.2.4",
|
|
46
|
+
"eslint-plugin-ts-type-forge": "0.8.5",
|
|
47
47
|
"jiti": "2.7.0",
|
|
48
48
|
"npm-run-all2": "9.0.3",
|
|
49
|
-
"prettier": "3.9.
|
|
49
|
+
"prettier": "3.9.9",
|
|
50
50
|
"prettier-plugin-organize-imports": "4.3.0",
|
|
51
51
|
"prettier-plugin-packagejson": "3.0.2",
|
|
52
|
-
"tsx": "4.23.
|
|
52
|
+
"tsx": "4.23.15",
|
|
53
53
|
"typescript": "6.0.3",
|
|
54
54
|
"typescript-native": "npm:typescript@7.0.2",
|
|
55
|
-
"vitest": "5.0.
|
|
55
|
+
"vitest": "5.0.2"
|
|
56
56
|
},
|
|
57
57
|
"engines": {
|
|
58
58
|
"node": ">=22.22.2",
|
|
59
59
|
"pnpm": ">=9.0.0"
|
|
60
60
|
},
|
|
61
61
|
"volta": {
|
|
62
|
-
"node": "26.
|
|
62
|
+
"node": "26.10.0"
|
|
63
63
|
},
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public",
|
|
@@ -35,7 +35,7 @@ export const ActionsSettings = t.record({
|
|
|
35
35
|
* `read` にできるのは、 workflow 側が全て明示的に `permissions` を宣言して
|
|
36
36
|
* いる場合だけ。宣言の無い job はこの既定値をそのまま受け取るため、
|
|
37
37
|
* `write` のままだと「 branch の中身が何であれ書き込めるトークン」が
|
|
38
|
-
* 渡る。 .github/workflows/
|
|
38
|
+
* 渡る。 .github/workflows/README.md の "Permissions" を参照。
|
|
39
39
|
*/
|
|
40
40
|
default_workflow_permissions: t.enumType(['read', 'write'], {
|
|
41
41
|
typeName: 'DefaultWorkflowPermissions',
|
|
@@ -86,18 +86,20 @@ describe('the ruleset schema', () => {
|
|
|
86
86
|
|
|
87
87
|
assert.deepStrictEqual(outcomeOf(files[0][0], declared), files[0][0]);
|
|
88
88
|
|
|
89
|
-
if (Result.
|
|
90
|
-
|
|
91
|
-
// carries more than the seven fields that go back out again.
|
|
92
|
-
const result = RulesetPicked.validate({
|
|
93
|
-
...declared.value,
|
|
94
|
-
source: 'noshiro-pf/mono',
|
|
95
|
-
source_type: 'Repository',
|
|
96
|
-
node_id: 'RRS_lACqUmVwb3NpdG9yeQ',
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
assert.isTrue(Result.isOk(result));
|
|
89
|
+
if (Result.isErr(declared)) {
|
|
90
|
+
return;
|
|
100
91
|
}
|
|
92
|
+
|
|
93
|
+
// `getRuleset` hands the whole API response to this type, and a response
|
|
94
|
+
// carries more than the seven fields that go back out again.
|
|
95
|
+
const result = RulesetPicked.validate({
|
|
96
|
+
...declared.value,
|
|
97
|
+
source: 'noshiro-pf/mono',
|
|
98
|
+
source_type: 'Repository',
|
|
99
|
+
node_id: 'RRS_lACqUmVwb3NpdG9yeQ',
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
assert.isTrue(Result.isOk(result));
|
|
101
103
|
});
|
|
102
104
|
|
|
103
105
|
test('accepts a ruleset built from values GitHub does use', () => {
|
|
@@ -99,12 +99,14 @@ describe(assertVariableNamesAreValid, () => {
|
|
|
99
99
|
|
|
100
100
|
assert.isTrue(Result.isErr(result));
|
|
101
101
|
|
|
102
|
-
if (Result.isErr(result)) {
|
|
103
|
-
|
|
102
|
+
if (!Result.isErr(result)) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
104
105
|
|
|
105
|
-
|
|
106
|
+
assert.isTrue(result.value.message.includes('WITH-HYPHEN'));
|
|
106
107
|
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
assert.isTrue(result.value.message.includes('GITHUB_TOKEN'));
|
|
109
|
+
|
|
110
|
+
assert.isFalse(result.value.message.includes('FINE'));
|
|
109
111
|
});
|
|
110
112
|
});
|