@goodandready/dsh-github-ops 0.1.0 → 0.1.1
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/CHANGELOG.md +10 -20
- package/README.md +37 -1
- package/README.ru.md +37 -1
- package/README.zh.md +37 -1
- package/lib/approval.js +30 -5
- package/lib/client.js +16 -1
- package/lib/index.js +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,27 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Notable changes to `@goodandready/dsh-github-ops`.
|
|
4
4
|
|
|
5
|
-
## 0.1.1
|
|
5
|
+
## 0.1.1 — released
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
- Writes pass through the approval contour: every write maps to a named action, an action
|
|
17
|
-
outside `allowedActions` is denied, destructive actions always ask, and only
|
|
18
|
-
`DSH_GITHUB_OPS_UNATTENDED=1` with `autoApprove` can skip a prompt.
|
|
19
|
-
- Background reviews: `gh_review_job` starts one and answers immediately;
|
|
20
|
-
`gh_review_job_status` reads it.
|
|
21
|
-
- Slash commands: `/pr create [title]`, `/review [number]`, `/issue new|list|show`, `/gh`.
|
|
22
|
-
A command never writes itself — it hands the model an instruction, so the write still goes
|
|
23
|
-
through the approval gate.
|
|
24
|
-
- Access can come from the DSH credential, the environment variable or the `gh` CLI session
|
|
25
|
-
(`tokenSource`), which is why a machine with `gh auth login` needs no extra configuration.
|
|
7
|
+
- `approvalMode` with "auto" as the default: an agreed, non-destructive write goes through
|
|
8
|
+
without a prompt, so a session whose host has approval prompts disabled is not blocked by a
|
|
9
|
+
question it cannot answer. Deleting a release, a tag, a secret, a variable, a ruleset,
|
|
10
|
+
cancelling a run or removing branch protection still asks, and where prompts are
|
|
11
|
+
unavailable that means it is refused — never automatic. "ask" prompts on every write;
|
|
12
|
+
"off" leaves the decision entirely to the host approval contour.
|
|
13
|
+
- `allowedActions` is the fence in every mode: an action outside it is denied outright.
|
|
14
|
+
- The setting is editable in the card (a three-option select) and documented in all three
|
|
15
|
+
READMEs.
|
|
26
16
|
|
|
27
17
|
## 0.1.0 — first release
|
|
28
18
|
|
package/README.md
CHANGED
|
@@ -1,4 +1,39 @@
|
|
|
1
|
-
# dsh-github-ops
|
|
1
|
+
# 📦 @goodandready/dsh-github-ops
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
<h3>Advanced GitHub Operations, Releases, CI Runs, Secrets & Sanitized Mirrors for DeepSeek Harness</h3>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/@goodandready/dsh-github-ops"><img src="https://img.shields.io/npm/v/@goodandready/dsh-github-ops.svg?style=for-the-badge&color=6366f1&labelColor=1e1b4b" alt="npm version"></a>
|
|
9
|
+
<a href="LICENSE"><img src="https://img.shields.io/github/license/GooDAnDReaDY/dsh-github-ops.svg?style=for-the-badge&color=10b981&labelColor=064e3b" alt="license"></a>
|
|
10
|
+
<a href="https://github.com/topics/dsh-plugin"><img src="https://img.shields.io/badge/DSH-Plugin-8b5cf6.svg?style=for-the-badge&labelColor=2e1065" alt="DSH Plugin"></a>
|
|
11
|
+
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/Node-20%2B-f59e0b.svg?style=for-the-badge&labelColor=451a03" alt="Node version"></a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center">
|
|
15
|
+
<a href="https://goodandready.app/"><img src="https://img.shields.io/badge/All_Author_Projects-goodandready.app-ff4500.svg?style=for-the-badge&logo=rocket&logoColor=white&labelColor=1a1a2e" alt="All Author Projects"></a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<a href="README.md"><b>🇬🇧 English</b></a> •
|
|
20
|
+
<a href="README.zh.md"><b>🇨🇳 中文说明</b></a> •
|
|
21
|
+
<a href="README.ru.md"><b>🇷🇺 Русский</b></a>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<table align="center">
|
|
25
|
+
<tr>
|
|
26
|
+
<td align="center">
|
|
27
|
+
⭐ <strong>If you like this plugin, please star it on GitHub</strong> — it shows me that the plugin is useful to you and motivates me to keep developing it.
|
|
28
|
+
<br><br>
|
|
29
|
+
🐛 <strong>If you find a bug or would like to request a feature</strong>, open a GitHub issue in any language — I will review your proposal and implement useful suggestions in a future plugin version.
|
|
30
|
+
</td>
|
|
31
|
+
</tr>
|
|
32
|
+
</table>
|
|
33
|
+
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
---
|
|
2
37
|
|
|
3
38
|
GitHub operations for [DeepSeek Harness](https://github.com/topics/dsh-plugin): releases,
|
|
4
39
|
tags, a guarded generic API pass-through, workflow runs, secrets and sanitized mirror
|
|
@@ -31,6 +66,7 @@ Requires a GitHub token in the DSH credential service. Store the token under a n
|
|
|
31
66
|
| `timeoutMs` | `30000` | Per-request timeout. |
|
|
32
67
|
| `maxRetries` | `2` | Retries for a failed read (never for a write). |
|
|
33
68
|
| `reviewRulesJson` | *(empty)* | Review-rule overrides as JSON: `sensitivePaths`, `sensitiveSeverity`, `attentionPaths`, `migrationPaths`, `testsRequired`, `sourcePatterns`, `testPatterns`, `largeDiffLines`. |
|
|
69
|
+
| `approvalMode` | `auto` | `auto` lets agreed non-destructive writes through without a prompt; deleting a release, tag, secret, variable, ruleset or branch protection, and cancelling a run, always ask. `ask` asks on every write; `off` leaves approvals to the host. |
|
|
34
70
|
| `allowedActions` | *(all)* | Write actions the plugin may perform; anything else is denied. Each one still asks. |
|
|
35
71
|
| `autoApprove` | *(empty)* | Actions an unattended run (`DSH_GITHUB_OPS_UNATTENDED=1`) may perform without asking. Destructive actions are never auto-approved. |
|
|
36
72
|
| `reviewJobTimeoutMs` | `120000` | How long a background review job may run. |
|
package/README.ru.md
CHANGED
|
@@ -1,4 +1,39 @@
|
|
|
1
|
-
# dsh-github-ops
|
|
1
|
+
# 📦 @goodandready/dsh-github-ops
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
<h3>Комплексные операции GitHub, релизы, CI-запуски, секреты и санитизированные зеркала для DeepSeek Harness</h3>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/@goodandready/dsh-github-ops"><img src="https://img.shields.io/npm/v/@goodandready/dsh-github-ops.svg?style=for-the-badge&color=6366f1&labelColor=1e1b4b" alt="npm version"></a>
|
|
9
|
+
<a href="LICENSE"><img src="https://img.shields.io/github/license/GooDAnDReaDY/dsh-github-ops.svg?style=for-the-badge&color=10b981&labelColor=064e3b" alt="license"></a>
|
|
10
|
+
<a href="https://github.com/topics/dsh-plugin"><img src="https://img.shields.io/badge/DSH-Plugin-8b5cf6.svg?style=for-the-badge&labelColor=2e1065" alt="DSH Plugin"></a>
|
|
11
|
+
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/Node-20%2B-f59e0b.svg?style=for-the-badge&labelColor=451a03" alt="Node version"></a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center">
|
|
15
|
+
<a href="https://goodandready.app/"><img src="https://img.shields.io/badge/Все_проекты_автора-goodandready.app-ff4500.svg?style=for-the-badge&logo=rocket&logoColor=white&labelColor=1a1a2e" alt="Все проекты автора"></a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<a href="README.md"><b>🇬🇧 English</b></a> •
|
|
20
|
+
<a href="README.zh.md"><b>🇨🇳 中文说明</b></a> •
|
|
21
|
+
<a href="README.ru.md"><b>🇷🇺 Русский</b></a>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<table align="center">
|
|
25
|
+
<tr>
|
|
26
|
+
<td align="center">
|
|
27
|
+
⭐ <strong>Если вам нравится этот плагин, поставьте ему Star на GitHub</strong> — это покажет мне, что плагин полезен, и добавит мотивации продолжать его развитие.
|
|
28
|
+
<br><br>
|
|
29
|
+
🐛 <strong>Если вы нашли ошибку или хотите предложить новую функцию</strong>, откройте issue на GitHub на любом удобном языке — я регулярно просматриваю предложения и реализую полезные идеи в будущих версиях плагина.
|
|
30
|
+
</td>
|
|
31
|
+
</tr>
|
|
32
|
+
</table>
|
|
33
|
+
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
---
|
|
2
37
|
|
|
3
38
|
Операции с GitHub для [DeepSeek Harness](https://github.com/topics/dsh-plugin): релизы,
|
|
4
39
|
теги, защищённый универсальный доступ к API, запуски workflow, секреты и публикация
|
|
@@ -31,6 +66,7 @@ dsh plugin --profile web add @goodandready/dsh-github-ops
|
|
|
31
66
|
| `timeoutMs` | `30000` | Таймаут одного запроса. |
|
|
32
67
|
| `maxRetries` | `2` | Повторы для неудачного чтения (запись не повторяется). |
|
|
33
68
|
| `reviewRulesJson` | пусто | Переопределение правил ревью в JSON: `sensitivePaths`, `sensitiveSeverity`, `attentionPaths`, `migrationPaths`, `testsRequired`, `sourcePatterns`, `testPatterns`, `largeDiffLines`. |
|
|
69
|
+
| `approvalMode` | `auto` | `auto` — согласованные неразрушительные записи проходят без вопроса; удаление релиза, тега, секрета, переменной, ruleset, защиты веток и отмена запуска спрашивают всегда. `ask` — спрашивать на каждую запись; `off` — решение целиком за штатным гейтом развёртывания. |
|
|
34
70
|
| `allowedActions` | все | Разрешённые записи; всё остальное отклоняется, и каждая всё равно спрашивает подтверждение. |
|
|
35
71
|
| `autoApprove` | пусто | Действия, которые неавтономный прогон (`DSH_GITHUB_OPS_UNATTENDED=1`) может выполнить без вопроса; разрушительные не автоутверждаются никогда. |
|
|
36
72
|
| `reviewJobTimeoutMs` | `120000` | Сколько может работать фоновая задача ревью. |
|
package/README.zh.md
CHANGED
|
@@ -1,4 +1,39 @@
|
|
|
1
|
-
# dsh-github-ops
|
|
1
|
+
# 📦 @goodandready/dsh-github-ops
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
<h3>面向 DeepSeek Harness 的高级 GitHub 操作、发布、CI 运行、密钥与净化镜像套件</h3>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/@goodandready/dsh-github-ops"><img src="https://img.shields.io/npm/v/@goodandready/dsh-github-ops.svg?style=for-the-badge&color=6366f1&labelColor=1e1b4b" alt="npm version"></a>
|
|
9
|
+
<a href="LICENSE"><img src="https://img.shields.io/github/license/GooDAnDReaDY/dsh-github-ops.svg?style=for-the-badge&color=10b981&labelColor=064e3b" alt="license"></a>
|
|
10
|
+
<a href="https://github.com/topics/dsh-plugin"><img src="https://img.shields.io/badge/DSH-Plugin-8b5cf6.svg?style=for-the-badge&labelColor=2e1065" alt="DSH Plugin"></a>
|
|
11
|
+
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/Node-20%2B-f59e0b.svg?style=for-the-badge&labelColor=451a03" alt="Node version"></a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center">
|
|
15
|
+
<a href="https://goodandready.app/"><img src="https://img.shields.io/badge/作者全部项目-goodandready.app-ff4500.svg?style=for-the-badge&logo=rocket&logoColor=white&labelColor=1a1a2e" alt="作者全部项目"></a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<a href="README.md"><b>🇬🇧 English</b></a> •
|
|
20
|
+
<a href="README.zh.md"><b>🇨🇳 中文说明</b></a> •
|
|
21
|
+
<a href="README.ru.md"><b>🇷🇺 Русский</b></a>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<table align="center">
|
|
25
|
+
<tr>
|
|
26
|
+
<td align="center">
|
|
27
|
+
⭐ <strong>如果您喜欢这个插件,请在 GitHub 上为它点亮 Star</strong> — 这能让我知道插件对您有用,并鼓励我继续开发和维护它。
|
|
28
|
+
<br><br>
|
|
29
|
+
🐛 <strong>如果您发现 Bug 或希望增加功能</strong>,请使用任意语言在 GitHub 上提交 Issue — 我会评估您的建议,并在后续版本中实现有价值的改进。
|
|
30
|
+
</td>
|
|
31
|
+
</tr>
|
|
32
|
+
</table>
|
|
33
|
+
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
---
|
|
2
37
|
|
|
3
38
|
面向 [DeepSeek Harness](https://github.com/topics/dsh-plugin) 的 GitHub 操作插件:发布(release)、
|
|
4
39
|
标签(tag)、受保护的通用 API 直通、工作流运行、密钥,以及经过净化的镜像发布。
|
|
@@ -28,6 +63,7 @@ dsh plugin --profile web add @goodandready/dsh-github-ops
|
|
|
28
63
|
| `timeoutMs` | `30000` | 单次请求超时。 |
|
|
29
64
|
| `maxRetries` | `2` | 读取失败时的重试次数(写入不重试)。 |
|
|
30
65
|
| `reviewRulesJson` | 空 | 以 JSON 覆盖评审规则:`sensitivePaths`、`sensitiveSeverity`、`attentionPaths`、`migrationPaths`、`testsRequired`、`sourcePatterns`、`testPatterns`、`largeDiffLines`。 |
|
|
66
|
+
| `approvalMode` | `auto` | `auto` 允许已同意的非破坏性写入免询问;删除 release、tag、secret、变量、ruleset、分支保护或取消运行仍会询问。`ask` 每次询问;`off` 交由宿主决定。 |
|
|
31
67
|
| `allowedActions` | 全部 | 允许执行的写操作;其余一律拒绝,且每个都会询问确认。 |
|
|
32
68
|
| `autoApprove` | 空 | 非交互运行(`DSH_GITHUB_OPS_UNATTENDED=1`)可免除询问的操作;破坏性操作永远不会被自动批准。 |
|
|
33
69
|
| `reviewJobTimeoutMs` | `120000` | 后台评审任务的最长运行时间。 |
|
package/lib/approval.js
CHANGED
|
@@ -128,36 +128,61 @@ export function isUnattended(env = process.env) {
|
|
|
128
128
|
return String((env && env.DSH_GITHUB_OPS_UNATTENDED) || '') === '1'
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
+
/** How the plugin treats a write. */
|
|
132
|
+
export const APPROVAL_MODES = ['auto', 'ask', 'off']
|
|
133
|
+
|
|
131
134
|
/**
|
|
132
135
|
* The policy, as a pure function.
|
|
133
136
|
*
|
|
137
|
+
* - `auto` (default): an agreed, non-destructive write goes through without a prompt, so a
|
|
138
|
+
* session whose host has approvals disabled is not blocked by a question it cannot answer.
|
|
139
|
+
* A destructive action still asks — and where prompts are unavailable that means it is
|
|
140
|
+
* refused, which is the intent: deleting a release, a tag, a secret, a ruleset or branch
|
|
141
|
+
* protection is never automatic.
|
|
142
|
+
* - `ask`: every write asks.
|
|
143
|
+
* - `off`: the plugin has no opinion; the host's own approval contour decides everything.
|
|
144
|
+
*
|
|
145
|
+
* `allowedActions` is the fence in every mode: an action outside it is denied outright.
|
|
146
|
+
*
|
|
134
147
|
* @returns {{kind: 'allow'|'ask'|'deny'|'continue', reason?: string, action?: string|null}}
|
|
135
148
|
*/
|
|
136
|
-
export function decide({ exec, allowedActions, autoApprove, unattended = false } = {}) {
|
|
149
|
+
export function decide({ exec, allowedActions, autoApprove, unattended = false, mode = 'auto' } = {}) {
|
|
137
150
|
const action = actionFor(exec)
|
|
138
151
|
if (!action) return { kind: 'continue', action: null }
|
|
152
|
+
if (mode === 'off') return { kind: 'continue', action }
|
|
139
153
|
|
|
140
154
|
const allowed = Array.isArray(allowedActions) && allowedActions.length ? allowedActions : ALL_ACTIONS
|
|
141
155
|
if (!allowed.includes(action)) {
|
|
142
156
|
return { kind: 'deny', action, reason: `dsh-github-ops: action "${action}" is not in allowedActions` }
|
|
143
157
|
}
|
|
144
|
-
|
|
145
|
-
|
|
158
|
+
|
|
159
|
+
const destructive = DESTRUCTIVE_ACTIONS.has(action)
|
|
160
|
+
if (destructive) {
|
|
161
|
+
return {
|
|
162
|
+
kind: 'ask',
|
|
163
|
+
action,
|
|
164
|
+
reason: `dsh-github-ops: ${askReason(exec)}. This cannot be undone here, so it is never automatic.`,
|
|
165
|
+
}
|
|
146
166
|
}
|
|
147
|
-
|
|
148
|
-
return { kind: '
|
|
167
|
+
|
|
168
|
+
if (mode === 'auto') return { kind: 'allow', action }
|
|
169
|
+
if (unattended && Array.isArray(autoApprove) && autoApprove.includes(action)) return { kind: 'allow', action }
|
|
170
|
+
return { kind: 'ask', action, reason: `dsh-github-ops: ${askReason(exec)}.` }
|
|
149
171
|
}
|
|
150
172
|
|
|
151
173
|
/**
|
|
152
174
|
* Register the gate. Registration is an effect: disposing the plugin removes the listener.
|
|
153
175
|
*/
|
|
154
176
|
export function registerApprovalGate(ctx, getConfig) {
|
|
177
|
+
const first = (typeof getConfig === 'function' ? getConfig() : getConfig) || {}
|
|
178
|
+
if (first.approvalMode === 'off') return () => {}
|
|
155
179
|
return ctx.on('tools/pre-execute', async (exec, next) => {
|
|
156
180
|
const cfg = (typeof getConfig === 'function' ? getConfig() : getConfig) || {}
|
|
157
181
|
const decision = decide({
|
|
158
182
|
exec,
|
|
159
183
|
allowedActions: cfg.allowedActions,
|
|
160
184
|
autoApprove: cfg.autoApprove,
|
|
185
|
+
mode: cfg.approvalMode || 'auto',
|
|
161
186
|
unattended: cfg.unattended !== undefined ? cfg.unattended : isUnattended(),
|
|
162
187
|
})
|
|
163
188
|
if (decision.kind === 'continue') return next()
|
package/lib/client.js
CHANGED
|
@@ -35,6 +35,8 @@ window.__ModuleLoader__.load({
|
|
|
35
35
|
timeoutMs: 'Request timeout, ms',
|
|
36
36
|
maxRetries: 'Retries for a failed read',
|
|
37
37
|
maxRetriesHint: 'A read (GET/HEAD) is retried on a network failure, a timeout or a 5xx. Writes are never retried automatically.',
|
|
38
|
+
approvalMode: 'Write approval',
|
|
39
|
+
approvalModeHint: '"auto" lets agreed non-destructive writes through without a prompt; deleting a release, tag, secret, variable, ruleset, branch protection or cancelling a run always asks. "ask" asks for every write; "off" leaves approvals to the host.',
|
|
38
40
|
reviewRules: 'Review rule overrides (JSON)',
|
|
39
41
|
reviewRulesHint: 'Optional. sensitivePaths, sensitiveSeverity, attentionPaths, migrationPaths, testsRequired, sourcePatterns, testPatterns, largeDiffLines. Example: {"largeDiffLines": 400, "sensitivePaths": [".env", "private/**"]}',
|
|
40
42
|
timeoutMsHint: 'How long one GitHub request may take before it is aborted.',
|
|
@@ -64,6 +66,8 @@ window.__ModuleLoader__.load({
|
|
|
64
66
|
timeoutMs: '请求超时(毫秒)',
|
|
65
67
|
maxRetries: '读取失败重试次数',
|
|
66
68
|
maxRetriesHint: '读取(GET/HEAD)在网络故障、超时或 5xx 时重试;写入不会自动重试。',
|
|
69
|
+
approvalMode: '写入审批',
|
|
70
|
+
approvalModeHint: '"auto" 允许已同意的非破坏性写入免询问;删除 release、tag、secret、变量、ruleset、分支保护或取消运行仍会询问。"ask" 每次写入都询问;"off" 交由宿主决定。',
|
|
67
71
|
reviewRules: '评审规则覆盖(JSON)',
|
|
68
72
|
reviewRulesHint: '可选。sensitivePaths、sensitiveSeverity、attentionPaths、migrationPaths、testsRequired、sourcePatterns、testPatterns、largeDiffLines。',
|
|
69
73
|
timeoutMsHint: '单个 GitHub 请求在被中断前允许的时长。',
|
|
@@ -181,7 +185,7 @@ window.__ModuleLoader__.load({
|
|
|
181
185
|
if (!scope || typeof scope.set !== 'function') return
|
|
182
186
|
setSaving(true)
|
|
183
187
|
const failed = []
|
|
184
|
-
const keys = ['tokenEnv', 'tokenSource', 'defaultRepository', 'baseUrl', 'timeoutMs', 'maxRetries', 'reviewRulesJson']
|
|
188
|
+
const keys = ['tokenEnv', 'tokenSource', 'defaultRepository', 'baseUrl', 'timeoutMs', 'maxRetries', 'reviewRulesJson', 'approvalMode']
|
|
185
189
|
for (const key of keys) {
|
|
186
190
|
if (current[key] === value[key]) continue
|
|
187
191
|
let next = current[key]
|
|
@@ -237,6 +241,17 @@ window.__ModuleLoader__.load({
|
|
|
237
241
|
field('baseUrl', 'baseUrl', 'baseUrlHint'),
|
|
238
242
|
field('timeoutMs', 'timeoutMs', 'timeoutMsHint', 'number'),
|
|
239
243
|
field('maxRetries', 'maxRetries', 'maxRetriesHint', 'number'),
|
|
244
|
+
React.createElement('div', { className: 'gho-field' },
|
|
245
|
+
React.createElement('label', { className: 'gho-label', htmlFor: `${NS}-approvalMode` }, t('approvalMode')),
|
|
246
|
+
React.createElement('div', { className: 'gho-hint' }, t('approvalModeHint')),
|
|
247
|
+
React.createElement('select', {
|
|
248
|
+
id: `${NS}-approvalMode`,
|
|
249
|
+
className: 'gho-input',
|
|
250
|
+
value: current.approvalMode || 'auto',
|
|
251
|
+
disabled: !writable,
|
|
252
|
+
onChange: (event) => change('approvalMode', event.target.value),
|
|
253
|
+
}, ['auto', 'ask', 'off'].map((option) => React.createElement('option', { key: option, value: option }, option))),
|
|
254
|
+
),
|
|
240
255
|
field('reviewRulesJson', 'reviewRules', 'reviewRulesHint', 'json'),
|
|
241
256
|
React.createElement('div', { className: 'gho-foot' },
|
|
242
257
|
React.createElement('span', { className: 'gho-note' }, message),
|
package/lib/index.js
CHANGED
|
@@ -108,6 +108,8 @@ export const Config = Schema.object({
|
|
|
108
108
|
.description('Retries for a read (GET/HEAD) on a network failure, a timeout or a 5xx. Writes are never retried automatically.'),
|
|
109
109
|
reviewRulesJson: Schema.string().default('')
|
|
110
110
|
.description('Optional review-rule overrides as JSON: sensitivePaths, sensitiveSeverity, attentionPaths, migrationPaths, testsRequired, sourcePatterns, testPatterns, largeDiffLines.'),
|
|
111
|
+
approvalMode: Schema.string().default('auto')
|
|
112
|
+
.description('"auto" (default): an agreed, non-destructive write goes through without a prompt, while deleting a release, tag, secret, variable, ruleset, branch protection or cancelling a run always asks. "ask": every write asks. "off": the plugin has no opinion and the host approval contour decides.'),
|
|
111
113
|
allowedActions: Schema.array(Schema.string()).default([])
|
|
112
114
|
.description('Write actions this plugin may perform; anything else is denied. Empty means every known action is allowed, and each one still asks for confirmation.'),
|
|
113
115
|
autoApprove: Schema.array(Schema.string()).default([])
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goodandready/dsh-github-ops",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "GitHub operations for DeepSeek Harness: releases, tags, a guarded generic API pass-through, workflow runs, secrets and sanitized mirror publication.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|