@theholocron/holocron-plugin-github 2.0.0-alpha.43 → 2.0.0-alpha.44

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.d.mts CHANGED
@@ -55,6 +55,8 @@ declare class GitHubSource implements Source {
55
55
  removeWorkflowFile(name: string): Promise<void>;
56
56
  writeRepoFile(path: string, contents: string): Promise<void>;
57
57
  syncLabels(canonical: ReadonlyArray<LabelDef>, stale: ReadonlyArray<string>): Promise<string>;
58
+ syncProperties(values: Record<string, string>): Promise<string>;
59
+ syncTopics(topics: string[]): Promise<string>;
58
60
  }
59
61
  //#endregion
60
62
  //#region src/capabilities/secrets.d.ts
package/dist/index.mjs CHANGED
@@ -483,6 +483,42 @@ async function syncLabels(rest, repo, canonical, stale) {
483
483
  return `${created} created, ${updated} updated, ${deleted} deleted`;
484
484
  }
485
485
  //#endregion
486
+ //#region src/capabilities/properties.ts
487
+ /**
488
+ * Sync custom property values for a repo to the org-defined schema.
489
+ *
490
+ * Calls `PATCH /repos/{owner}/{name}/properties/values` with the full
491
+ * map — GitHub replaces only the supplied keys, leaving others untouched.
492
+ */
493
+ async function syncProperties(rest, repo, values) {
494
+ const { owner, name } = parseRepo(repo);
495
+ const properties = Object.entries(values).map(([property_name, value]) => ({
496
+ property_name,
497
+ value
498
+ }));
499
+ await rest.request(`/repos/${owner}/${name}/properties/values`, {
500
+ method: "PATCH",
501
+ body: { properties }
502
+ });
503
+ return `${properties.length} properties set`;
504
+ }
505
+ //#endregion
506
+ //#region src/capabilities/topics.ts
507
+ /**
508
+ * Replace a repo's topic set with the supplied list.
509
+ *
510
+ * Calls `PUT /repos/{owner}/{name}/topics` — GitHub replaces the full
511
+ * set atomically, so the config is always the source of truth.
512
+ */
513
+ async function syncTopics(rest, repo, topics) {
514
+ const { owner, name } = parseRepo(repo);
515
+ await rest.request(`/repos/${owner}/${name}/topics`, {
516
+ method: "PUT",
517
+ body: { names: topics }
518
+ });
519
+ return `${topics.length} topics set`;
520
+ }
521
+ //#endregion
486
522
  //#region src/capabilities/source.ts
487
523
  /**
488
524
  * `source` capability for GitHub.
@@ -640,6 +676,12 @@ var GitHubSource = class {
640
676
  async syncLabels(canonical, stale) {
641
677
  return syncLabels(this.rest, `${this.owner}/${this.name}`, canonical, stale);
642
678
  }
679
+ async syncProperties(values) {
680
+ return syncProperties(this.rest, `${this.owner}/${this.name}`, values);
681
+ }
682
+ async syncTopics(topics) {
683
+ return syncTopics(this.rest, `${this.owner}/${this.name}`, topics);
684
+ }
643
685
  };
644
686
  function isENOENT(err) {
645
687
  return typeof err === "object" && err !== null && "code" in err && err.code === "ENOENT";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/holocron-plugin-github",
3
- "version": "2.0.0-alpha.43",
3
+ "version": "2.0.0-alpha.44",
4
4
  "description": "Holocron plugin for GitHub. Implements source, ci, secrets, environments, and issues capabilities against the GitHub REST API.",
5
5
  "homepage": "https://github.com/theholocron/holocron/tree/main/packages/holocron-plugin-github#readme",
6
6
  "bugs": "https://github.com/theholocron/holocron/issues",
@@ -21,7 +21,7 @@
21
21
  }
22
22
  },
23
23
  "peerDependencies": {
24
- "@theholocron/cli": "2.0.0-alpha.43"
24
+ "@theholocron/cli": "2.0.0-alpha.44"
25
25
  },
26
26
  "dependencies": {
27
27
  "libsodium-wrappers": "^0.7.15"
@@ -41,7 +41,7 @@
41
41
  "tsx": "^4.22.4",
42
42
  "typescript": "^5.9.3",
43
43
  "vitest": "^4.1.10",
44
- "@theholocron/cli": "2.0.0-alpha.43"
44
+ "@theholocron/cli": "2.0.0-alpha.44"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"