@theholocron/holocron-plugin-github 5.0.0-alpha.437 → 5.0.0-alpha.442
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +18 -12
- package/package.json +8 -8
package/dist/index.mjs
CHANGED
|
@@ -2216,7 +2216,7 @@ const EXPECTED = {
|
|
|
2216
2216
|
secrets: "absent"
|
|
2217
2217
|
}),
|
|
2218
2218
|
HOLOCRON_ORG_TOKEN: everywhere({
|
|
2219
|
-
|
|
2219
|
+
administration: "required",
|
|
2220
2220
|
"org-members": "required",
|
|
2221
2221
|
"org-variables": "required",
|
|
2222
2222
|
"org-secrets": "absent"
|
|
@@ -2271,7 +2271,7 @@ function parseTokenArgs(args) {
|
|
|
2271
2271
|
* Every permission the GitHub plugin's tokens are declared against, by the name the declaration uses, with one read
|
|
2272
2272
|
* that needs it. A read proves the token can see the area, not that it can write to it: GitHub exposes no list of a
|
|
2273
2273
|
* fine-grained token's permissions, so the write half of `read/write` is taken from the permission table in
|
|
2274
|
-
* `docs/src/content/docs/tokens.mdx`. On a public repository the `contents`, `actions`, `issues
|
|
2274
|
+
* `docs/src/content/docs/tokens.mdx`. On a public repository the `contents`, `actions`, `issues`, `pull-requests` and `environments`
|
|
2275
2275
|
* reads succeed for any token, so only the other permissions can prove a permission absent. Names with more than one
|
|
2276
2276
|
* word are hyphenated, not underscored: `holocron probe docs tokens` strips `_` (Markdown emphasis) from a table cell
|
|
2277
2277
|
* before it compares the id with the declaration.
|
|
@@ -2279,19 +2279,23 @@ function parseTokenArgs(args) {
|
|
|
2279
2279
|
const PERMISSIONS = {
|
|
2280
2280
|
contents: {
|
|
2281
2281
|
label: "Contents",
|
|
2282
|
-
path: "/repos/{r}/contents"
|
|
2282
|
+
path: "/repos/{r}/contents",
|
|
2283
|
+
publicRead: true
|
|
2283
2284
|
},
|
|
2284
2285
|
actions: {
|
|
2285
2286
|
label: "Actions",
|
|
2286
|
-
path: "/repos/{r}/actions/runs?per_page=1"
|
|
2287
|
+
path: "/repos/{r}/actions/runs?per_page=1",
|
|
2288
|
+
publicRead: true
|
|
2287
2289
|
},
|
|
2288
2290
|
issues: {
|
|
2289
2291
|
label: "Issues",
|
|
2290
|
-
path: "/repos/{r}/issues?per_page=1"
|
|
2292
|
+
path: "/repos/{r}/issues?per_page=1",
|
|
2293
|
+
publicRead: true
|
|
2291
2294
|
},
|
|
2292
2295
|
"pull-requests": {
|
|
2293
2296
|
label: "Pull requests",
|
|
2294
|
-
path: "/repos/{r}/pulls?per_page=1"
|
|
2297
|
+
path: "/repos/{r}/pulls?per_page=1",
|
|
2298
|
+
publicRead: true
|
|
2295
2299
|
},
|
|
2296
2300
|
administration: {
|
|
2297
2301
|
label: "Administration",
|
|
@@ -2303,7 +2307,8 @@ const PERMISSIONS = {
|
|
|
2303
2307
|
},
|
|
2304
2308
|
environments: {
|
|
2305
2309
|
label: "Environments",
|
|
2306
|
-
path: "/repos/{r}/environments?per_page=1"
|
|
2310
|
+
path: "/repos/{r}/environments?per_page=1",
|
|
2311
|
+
publicRead: true
|
|
2307
2312
|
},
|
|
2308
2313
|
"actions-variables": {
|
|
2309
2314
|
label: "Variables",
|
|
@@ -2317,10 +2322,6 @@ const PERMISSIONS = {
|
|
|
2317
2322
|
label: "Pages",
|
|
2318
2323
|
path: "/repos/{r}/pages"
|
|
2319
2324
|
},
|
|
2320
|
-
"org-administration": {
|
|
2321
|
-
label: "Organization: Administration",
|
|
2322
|
-
path: "/orgs/{o}/actions/permissions"
|
|
2323
|
-
},
|
|
2324
2325
|
"org-members": {
|
|
2325
2326
|
label: "Organization: Members",
|
|
2326
2327
|
path: "/orgs/{o}/members?per_page=1"
|
|
@@ -2384,7 +2385,7 @@ async function reach(ctx, token, permission) {
|
|
|
2384
2385
|
* judges: a required permission the token lacks fails, and one the layer must not have fails when the token has it; a
|
|
2385
2386
|
* permission that is rightly absent is a bare `ok`.
|
|
2386
2387
|
*/
|
|
2387
|
-
function rowFor({ label, outcome }, rule) {
|
|
2388
|
+
function rowFor({ label, permission, outcome }, rule) {
|
|
2388
2389
|
if (outcome.kind === "error") return {
|
|
2389
2390
|
status: "fail",
|
|
2390
2391
|
label,
|
|
@@ -2396,6 +2397,11 @@ function rowFor({ label, outcome }, rule) {
|
|
|
2396
2397
|
label,
|
|
2397
2398
|
detail: outcome.detail
|
|
2398
2399
|
};
|
|
2400
|
+
if (rule === "absent" && has && PERMISSIONS[permission].publicRead) return {
|
|
2401
|
+
status: "info",
|
|
2402
|
+
label,
|
|
2403
|
+
detail: `${outcome.detail}, which any token can on a public repository: not proof either way`
|
|
2404
|
+
};
|
|
2399
2405
|
if (rule === "absent") return has ? {
|
|
2400
2406
|
status: "fail",
|
|
2401
2407
|
label,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/holocron-plugin-github",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.442",
|
|
4
4
|
"description": "Holocron plugin for GitHub. Implements source, ci, secrets, environments, and issues capabilities against the GitHub REST API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ci",
|
|
@@ -44,21 +44,21 @@
|
|
|
44
44
|
"tsx": "4.23.15",
|
|
45
45
|
"typescript": "^5.9.3",
|
|
46
46
|
"vitest": "^5.1.0",
|
|
47
|
-
"@theholocron/cli": "5.0.0-alpha.
|
|
47
|
+
"@theholocron/cli": "5.0.0-alpha.442",
|
|
48
|
+
"@theholocron/eslint-config": "^8.9.0-alpha.17",
|
|
48
49
|
"@theholocron/fs-utils": "^1.17.0-alpha.4",
|
|
49
50
|
"@theholocron/github-client": "^1.58.0-alpha.32",
|
|
50
|
-
"@theholocron/
|
|
51
|
-
"@theholocron/eslint-config": "^8.9.0-alpha.17",
|
|
52
|
-
"@theholocron/tsconfig": "^8.9.0-alpha.17",
|
|
53
|
-
"@theholocron/tsdown-config": "^8.9.0-alpha.17",
|
|
51
|
+
"@theholocron/misc-utils": "^1.17.0-alpha.4",
|
|
54
52
|
"@theholocron/vitest-config": "^8.9.0-alpha.17",
|
|
55
|
-
"@theholocron/
|
|
53
|
+
"@theholocron/tsdown-config": "^8.9.0-alpha.17",
|
|
54
|
+
"@theholocron/tsconfig": "^8.9.0-alpha.17",
|
|
55
|
+
"@theholocron/http-client": "^1.58.0-alpha.32"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@theholocron/fs-utils": "^1.16.0",
|
|
59
59
|
"@theholocron/github-client": "^1.58.0",
|
|
60
60
|
"@theholocron/misc-utils": "^1.16.0",
|
|
61
|
-
"@theholocron/cli": "5.0.0-alpha.
|
|
61
|
+
"@theholocron/cli": "5.0.0-alpha.442"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
64
64
|
"node": ">=22"
|