@theholocron/holocron-plugin-github 5.0.0-alpha.421 → 5.0.0-alpha.423

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 CHANGED
@@ -40,11 +40,11 @@ Each capability resolves its own fine-grained token so a compromised credential
40
40
  Store tokens once via the keyring so they are picked up automatically:
41
41
 
42
42
  ```sh
43
- holocron auth set github.read ghp_xxx # clone + CI run listing
44
- holocron auth set github.issues ghp_xxx # issue management
45
- holocron auth set github.sync ghp_xxx # sync-github workflow templates
46
- holocron auth set github.release ghp_xxx # semantic-release
47
- holocron auth set github.admin ghp_xxx # setup, secrets, environments
43
+ holocron new token github.read ghp_xxx # clone + CI run listing
44
+ holocron new token github.issues ghp_xxx # issue management
45
+ holocron new token github.sync ghp_xxx # sync-github workflow templates
46
+ holocron new token github.release ghp_xxx # semantic-release
47
+ holocron new token github.admin ghp_xxx # setup, secrets, environments
48
48
  ```
49
49
 
50
50
  See the [token reference](https://docs.theholocron.dev/holocron/tokens/) for full scope requirements and CI setup.
@@ -68,7 +68,7 @@ See the [token reference](https://docs.theholocron.dev/holocron/tokens/) for ful
68
68
 
69
69
  ## `projects` capability
70
70
 
71
- GitHub Projects v2 boards over GraphQL, for `holocron project ...` (SPEC-0020, #1744). It uses the org token
71
+ GitHub Projects v2 boards over GraphQL, for `list projects`, `new project`, `setup project` (SPEC-0020, #1744). It uses the org token
72
72
  (`HOLOCRON_ORG_TOKEN`, keyring `github.org`) with the **Projects** organization permission. Items are keyed `#N` in the
73
73
  configured `repo` and `owner/repo#N` elsewhere.
74
74
 
package/dist/index.d.mts CHANGED
@@ -444,10 +444,13 @@ export declare function createPlugin(options: GitHubPluginOptions): {
444
444
  };
445
445
  };
446
446
  /**
447
- * One-line hint printed by `holocron auth set github` when no token
447
+ * One-line hint printed by `holocron new token github` when no token
448
448
  * is supplied or the supplied token is rejected.
449
449
  */
450
450
  export declare const AUTH_HINT: string;
451
- /** Every token this plugin takes, for `holocron doctor tokens`. */
451
+ /**
452
+ * Every token this plugin takes, for `holocron doctor tokens`. The release token is `optional`: only CI's release
453
+ * workflow reads it (from the org secret), so a development environment has no reason to hold it.
454
+ */
452
455
  export declare const tokens: PluginToken[];
453
456
  export { type Auth, AuthError, type CanonicalLabel, type GitHubClientOptions, type NormalizedTeamEntry, type ProjectsOptions, type ResolveTokenInput, type TeamEntry, type TeamPermission, type VerifyTokenFailure, type VerifyTokenResult, type VerifyTokenSuccess, createFeatureResolver, createGitHubClient };
package/dist/index.mjs CHANGED
@@ -1460,7 +1460,7 @@ function toGHScope(scope) {
1460
1460
  /** Reads one file; `null` when it does not exist. `version` is the blob sha `writeFile` needs to replace exactly this one. */
1461
1461
  /** A fine-grained token only reaches the repositories and permissions it was given; say which one is missing. */
1462
1462
  function noAccess(repo, action, cause) {
1463
- return new Error(`the token cannot ${action} files in ${repo} (403): give the user-sync token (HOLOCRON_USER_SYNC_TOKEN, or holocron auth set github.user-sync) access to that repository with Contents: ${action === "read" ? "read" : "read and write"}`, { cause });
1463
+ return new Error(`the token cannot ${action} files in ${repo} (403): give the user-sync token (HOLOCRON_USER_SYNC_TOKEN, or holocron new token github.user-sync) access to that repository with Contents: ${action === "read" ? "read" : "read and write"}`, { cause });
1464
1464
  }
1465
1465
  async function readRepoFile(client, repo, path) {
1466
1466
  try {
@@ -1549,10 +1549,10 @@ function propertyFixHints(githubMessage) {
1549
1549
  if (!values.includes(value)) values.push(value);
1550
1550
  byProperty.set(property, values);
1551
1551
  }
1552
- return [...byProperty].map(([property, values]) => `add ${values.map((v) => `"${v}"`).join(", ")} to the allowed values of the organization custom property ${property} (the organization's Settings, Custom properties), then run repo setup again`);
1552
+ return [...byProperty].map(([property, values]) => `add ${values.map((v) => `"${v}"`).join(", ")} to the allowed values of the organization custom property ${property} (the organization's Settings, Custom properties), then run setup again`);
1553
1553
  }
1554
1554
  // src/capabilities/rejected-properties.ts
1555
- /** The values `repo setup` sends for `true_false` properties; anything else is rejected. */
1555
+ /** The values `setup` sends for `true_false` properties; anything else is rejected. */
1556
1556
  const BOOLEANS = /* @__PURE__ */ new Set(["true", "false"]);
1557
1557
  /**
1558
1558
  * What is wrong with `values` when compared with the organization's property definitions, one sentence per
@@ -1654,7 +1654,7 @@ async function addOrgPropertyValues(client, repo, name, values) {
1654
1654
  return added;
1655
1655
  }
1656
1656
  // src/capabilities/read-repo.ts
1657
- /** The settings `repo setup` writes, which `GET /repos/{repo}` reports under the same names. */
1657
+ /** The settings `setup` writes, which `GET /repos/{repo}` reports under the same names. */
1658
1658
  const SETTING_KEYS = [
1659
1659
  "allow_squash_merge",
1660
1660
  "allow_merge_commit",
@@ -1683,7 +1683,7 @@ async function readRepoInfo(client, repo) {
1683
1683
  settings
1684
1684
  };
1685
1685
  }
1686
- /** A ruleset reduced to what `repo setup` writes: its enforcement, rule types and required status checks. */
1686
+ /** A ruleset reduced to what `setup` writes: its enforcement, rule types and required status checks. */
1687
1687
  function toRulesetDetail(data) {
1688
1688
  const rules = data.rules ?? [];
1689
1689
  const checks = rules.find((r) => r.type === "required_status_checks")?.parameters?.required_status_checks;
@@ -2031,7 +2031,7 @@ var GitHubSource = class {
2031
2031
  return syncVariables(this.client, this.repo, variables, opts);
2032
2032
  }
2033
2033
  async syncOrgVariables(org, variables, opts) {
2034
- if (!this.orgClient) throw new Error("organization variables need the org token: set HOLOCRON_ORG_TOKEN or run `holocron auth set github.org <token>`");
2034
+ if (!this.orgClient) throw new Error("organization variables need the org token: set HOLOCRON_ORG_TOKEN or run `holocron new token github.org <token>`");
2035
2035
  return syncOrgVariables(this.orgClient, this.repo, org, variables, opts);
2036
2036
  }
2037
2037
  async listVariables() {
@@ -2039,7 +2039,7 @@ var GitHubSource = class {
2039
2039
  return Object.fromEntries(found.map((v) => [v.name, v.value]));
2040
2040
  }
2041
2041
  async listOrgVariables(org) {
2042
- if (!this.orgClient) throw new MissingTokenError("organization variables need the org token: set HOLOCRON_ORG_TOKEN or run `holocron auth set github.org <token>`");
2042
+ if (!this.orgClient) throw new MissingTokenError("organization variables need the org token: set HOLOCRON_ORG_TOKEN or run `holocron new token github.org <token>`");
2043
2043
  const found = await this.orgClient.variables.listVariables(this.repo, {
2044
2044
  kind: "organization",
2045
2045
  org
@@ -2292,20 +2292,26 @@ function createPlugin(options) {
2292
2292
  };
2293
2293
  }
2294
2294
  /**
2295
- * One-line hint printed by `holocron auth set github` when no token
2295
+ * One-line hint printed by `holocron new token github` when no token
2296
2296
  * is supplied or the supplied token is rejected.
2297
2297
  */
2298
- const AUTH_HINT = "generate fine-grained Personal Access Tokens at https://github.com/settings/tokens (one per feature — see docs/tokens.md for required scopes per operation), then run: holocron auth set github.<feature> <PAT>";
2299
- /** Every token this plugin takes, for `holocron doctor tokens`. */
2298
+ const AUTH_HINT = "generate fine-grained Personal Access Tokens at https://github.com/settings/tokens (one per feature — see docs/tokens.md for required scopes per operation), then run: holocron new token github.<feature> <PAT>";
2299
+ /**
2300
+ * Every token this plugin takes, for `holocron doctor tokens`. The release token is `optional`: only CI's release
2301
+ * workflow reads it (from the org secret), so a development environment has no reason to hold it.
2302
+ */
2300
2303
  const tokens = [
2301
- resolveReadToken,
2302
- resolveIssuesToken,
2303
- resolveSyncToken,
2304
- resolveReleaseToken,
2305
- resolveAdminToken,
2306
- resolveSecretsToken,
2307
- resolveDeployToken,
2308
- resolveUserSyncToken,
2309
- resolveOrgToken
2310
- ].map((resolver) => resolver.token);
2304
+ resolveReadToken.token,
2305
+ resolveIssuesToken.token,
2306
+ resolveSyncToken.token,
2307
+ {
2308
+ ...resolveReleaseToken.token,
2309
+ optional: true
2310
+ },
2311
+ resolveAdminToken.token,
2312
+ resolveSecretsToken.token,
2313
+ resolveDeployToken.token,
2314
+ resolveUserSyncToken.token,
2315
+ resolveOrgToken.token
2316
+ ];
2311
2317
  export { AUTH_HINT, AuthError, GitHubCi, GitHubEnvironments, GitHubIssues, GitHubProjects, GitHubSecrets, GitHubSource, ci, createFeatureResolver, createGitHubClient, createPlugin, encryptSecret, environments, issues, normalizeTeamEntry, projects, resolveAdminToken, resolveDeployToken, resolveIssuesToken, resolveOrgToken, resolveReadToken, resolveReleaseToken, resolveSecretsToken, resolveSyncToken, resolveUserSyncToken, secrets, source, syncLabels, syncTeams, tokens, verifyToken };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/holocron-plugin-github",
3
- "version": "5.0.0-alpha.421",
3
+ "version": "5.0.0-alpha.423",
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.421",
48
- "@theholocron/eslint-config": "^8.9.0-alpha.16",
49
- "@theholocron/github-client": "^1.58.0-alpha.28",
50
- "@theholocron/http-client": "^1.58.0-alpha.28",
51
- "@theholocron/misc-utils": "^1.17.0-alpha.4",
47
+ "@theholocron/eslint-config": "^8.9.0-alpha.17",
48
+ "@theholocron/cli": "5.0.0-alpha.423",
52
49
  "@theholocron/fs-utils": "^1.17.0-alpha.4",
53
- "@theholocron/tsconfig": "^8.9.0-alpha.16",
54
- "@theholocron/tsdown-config": "^8.9.0-alpha.16",
55
- "@theholocron/vitest-config": "^8.9.0-alpha.16"
50
+ "@theholocron/github-client": "^1.58.0-alpha.29",
51
+ "@theholocron/http-client": "^1.58.0-alpha.29",
52
+ "@theholocron/tsconfig": "^8.9.0-alpha.17",
53
+ "@theholocron/vitest-config": "^8.9.0-alpha.17",
54
+ "@theholocron/misc-utils": "^1.17.0-alpha.4",
55
+ "@theholocron/tsdown-config": "^8.9.0-alpha.17"
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.421"
61
+ "@theholocron/cli": "5.0.0-alpha.423"
62
62
  },
63
63
  "engines": {
64
64
  "node": ">=22"