@theholocron/holocron-plugin-github 5.0.0-alpha.56 → 5.0.0-alpha.561
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 +33 -8
- package/dist/index.d.mts +354 -76
- package/dist/index.mjs +3970 -154
- package/package.json +30 -26
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# `@theholocron/holocron-plugin-github`
|
|
2
2
|
|
|
3
|
-
GitHub plugin for [Holocron](../cli). Implements
|
|
4
|
-
against the GitHub REST
|
|
3
|
+
GitHub plugin for [Holocron](../cli). Implements six capabilities
|
|
4
|
+
against the GitHub REST and GraphQL APIs:
|
|
5
5
|
|
|
6
6
|
| Capability | What this plugin does |
|
|
7
7
|
| -------------- | ---------------------------------------------------------------- |
|
|
@@ -10,6 +10,7 @@ against the GitHub REST API:
|
|
|
10
10
|
| `secrets` | GH Actions secrets (repo + environment + organization) |
|
|
11
11
|
| `environments` | Named deployment environments (reviewers, wait timers) |
|
|
12
12
|
| `issues` | GitHub Issues as a tracker (with lifecycle slots) |
|
|
13
|
+
| `projects` | GitHub Projects v2 boards (GraphQL) |
|
|
13
14
|
|
|
14
15
|
## Install
|
|
15
16
|
|
|
@@ -34,18 +35,19 @@ Each capability resolves its own fine-grained token so a compromised credential
|
|
|
34
35
|
| `HOLOCRON_SYNC_TOKEN` | `github.sync` | `sync-github` command |
|
|
35
36
|
| `HOLOCRON_RELEASE_TOKEN` | `github.release` | semantic-release, GitHub releases |
|
|
36
37
|
| `HOLOCRON_ADMIN_TOKEN` | `github.admin` | `source`, `secrets`, `environments` |
|
|
38
|
+
| `HOLOCRON_ORG_TOKEN` | `github.org` | `projects` |
|
|
37
39
|
|
|
38
40
|
Store tokens once via the keyring so they are picked up automatically:
|
|
39
41
|
|
|
40
42
|
```sh
|
|
41
|
-
holocron
|
|
42
|
-
holocron
|
|
43
|
-
holocron
|
|
44
|
-
holocron
|
|
45
|
-
holocron
|
|
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
|
|
46
48
|
```
|
|
47
49
|
|
|
48
|
-
See [
|
|
50
|
+
See the [token reference](https://docs.theholocron.dev/holocron/tokens/) for full scope requirements and CI setup.
|
|
49
51
|
|
|
50
52
|
## Config
|
|
51
53
|
|
|
@@ -64,6 +66,29 @@ See [docs/tokens.md](../../docs/tokens.md) for full scope requirements and CI se
|
|
|
64
66
|
|
|
65
67
|
```
|
|
66
68
|
|
|
69
|
+
## `projects` capability
|
|
70
|
+
|
|
71
|
+
GitHub Projects v2 boards over GraphQL, for `list projects`, `new project`, `setup project` (SPEC-0020, #1744). It uses the org token
|
|
72
|
+
(`HOLOCRON_ORG_TOKEN`, keyring `github.org`) with the **Projects** organization permission. Items are keyed `#N` in the
|
|
73
|
+
configured `repo` and `owner/repo#N` elsewhere.
|
|
74
|
+
|
|
75
|
+
| Method | What it does |
|
|
76
|
+
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
77
|
+
| `list` | Every project of the organization, open and closed. `find` is the exact name among the open ones. |
|
|
78
|
+
| `create` | Copies the board `template.source` names (fields, options, views, automation rules, no items), or creates a project and applies the template. |
|
|
79
|
+
| `close` | `updateProjectV2` with `closed: true`. Reversible. |
|
|
80
|
+
| `read` | Statuses, other fields, board and table views and automation rules. |
|
|
81
|
+
| `ensure` | Adds what the template lists and the board lacks (options, fields, views, filters). Never deletes. Rules and view grouping the API cannot set come back as `todos`. |
|
|
82
|
+
| `items` | Each issue or pull request with its status, category, whether it is open and its open blockers. |
|
|
83
|
+
| `setStatus` | Sets an item's status. Idempotent: `transitioned: false` when it is already there. |
|
|
84
|
+
| `move` | Puts open items on another board with status and priority (only where the target has none); closed and merged ones stay and are set to done when theirs is not a done one. |
|
|
85
|
+
| `whoami` | How many boards the token sees, for `holocron doctor`. |
|
|
86
|
+
|
|
87
|
+
`ensure` is safe on a field that has items. `updateProjectV2Field` replaces a single select field's whole option list,
|
|
88
|
+
and an option sent without its `id` blanks the field on every item, so `ensure` reads the field first, sends every
|
|
89
|
+
existing option with its `id` in the template's order (new ones without), and stops when the field cannot be read. It
|
|
90
|
+
also keeps the item values in memory and, if a re-read shows any gone, writes them back by option name and fails.
|
|
91
|
+
|
|
67
92
|
## Status
|
|
68
93
|
|
|
69
94
|
**`v2.0.0-alpha.0`** — published on npm under the `alpha` dist-tag.
|