Skip to content

Commit 189c0aa

Browse files
committed
Merge remote-tracking branch 'upstream/main'
# Conflicts: # docs/channels/feishu.md # docs/web/control-ui.md # extensions/feishu/src/setup-surface.ts # src/agents/pi-embedded-subscribe.handlers.tools.ts # src/agents/tools-effective-inventory.ts # src/auto-reply/reply/commands-info.tools.test.ts # src/auto-reply/status.ts # ui/src/ui/app-gateway.sessions.node.test.ts
2 parents c2f0b34 + 67593a8 commit 189c0aa

1,564 files changed

Lines changed: 84434 additions & 24415 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/openclaw-release-maintainer/SKILL.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ node --import tsx scripts/openclaw-npm-postpublish-verify.ts <published-version>
120120
`.github/workflows/openclaw-npm-release.yml`, but it still needs a valid
121121
`NPM_TOKEN` because `npm dist-tag` management is separate from trusted
122122
publishing.
123+
- Direct stable publishes can also run the same workflow with
124+
`sync_stable_dist_tags=true` to point both `latest` and `beta` at the
125+
already-published stable version. This also needs the `npm-release`
126+
environment approval and `NPM_TOKEN`.
123127
- The publish run must be started manually with `workflow_dispatch`.
124128
- The npm workflow and the private mac publish workflow accept
125129
`preflight_only=true` to run validation/build/package steps without uploading
@@ -178,7 +182,10 @@ node --import tsx scripts/openclaw-npm-postpublish-verify.ts <published-version>
178182
plan does not yet support required reviewers there, do not assume the
179183
environment alone is the approval boundary; rely on private repo access and
180184
CODEOWNERS until those settings can be enabled.
181-
- Do not use `NPM_TOKEN` or the plugin OTP flow for OpenClaw releases.
185+
- Do not use `NPM_TOKEN` or the plugin OTP flow for the OpenClaw package
186+
publish path; package publishing uses trusted publishing.
187+
- Use `NPM_TOKEN` only for explicit npm dist-tag management modes, because npm
188+
does not support trusted publishing for `npm dist-tag add`.
182189
- `@openclaw/*` plugin publishes use a separate maintainer-only flow.
183190
- Only publish plugins that already exist on npm; bundled disk-tree-only plugins stay unpublished.
184191

@@ -248,19 +255,25 @@ node --import tsx scripts/openclaw-npm-postpublish-verify.ts <published-version>
248255
passes with the same stable tag, `promote_beta_to_latest=true`,
249256
`preflight_only=false`, empty `preflight_run_id`, and `npm_dist_tag=beta`,
250257
then verify `latest` now points at that version.
251-
17. Start
258+
17. If the stable release was published directly to `latest` and `beta` should
259+
follow it, start `.github/workflows/openclaw-npm-release.yml` again with
260+
the same stable tag, `sync_stable_dist_tags=true`,
261+
`promote_beta_to_latest=false`, `preflight_only=false`, empty
262+
`preflight_run_id`, and `npm_dist_tag=latest`, then verify both `latest`
263+
and `beta` point at that version.
264+
18. Start
252265
`openclaw/releases-private/.github/workflows/openclaw-macos-publish.yml`
253266
for the real publish with the successful private mac `preflight_run_id` and
254267
wait for success.
255-
18. Verify the successful real private mac run uploaded the `.zip`, `.dmg`,
268+
19. Verify the successful real private mac run uploaded the `.zip`, `.dmg`,
256269
and `.dSYM.zip` artifacts to the existing GitHub release in
257270
`openclaw/openclaw`.
258-
19. For stable releases, download `macos-appcast-<tag>` from the successful
271+
20. For stable releases, download `macos-appcast-<tag>` from the successful
259272
private mac run, update `appcast.xml` on `main`, and verify the feed.
260-
20. For beta releases, publish the mac assets but expect no shared production
273+
21. For beta releases, publish the mac assets but expect no shared production
261274
`appcast.xml` artifact and do not update the shared production feed unless a
262275
separate beta feed exists.
263-
21. After publish, verify npm and the attached release artifacts.
276+
22. After publish, verify npm and the attached release artifacts.
264277

265278
## GHSA advisory work
266279

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
---
2+
name: openclaw-secret-scanning-maintainer
3+
description: Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
4+
---
5+
6+
# OpenClaw Secret Scanning Maintainer
7+
8+
**Maintainer-only.** This skill requires repo admin / maintainer permissions to edit or delete other users' comments and resolve secret scanning alerts.
9+
10+
Use this skill when processing alerts from `https://github.com/openclaw/openclaw/security/secret-scanning`.
11+
12+
**Language rule:** All notification comments and replacement comments MUST be written in English.
13+
14+
## Script
15+
16+
All mechanical operations (API calls, temp file management, security enforcements) are handled by:
17+
18+
```
19+
$REPO_ROOT/.agents/skills/openclaw-secret-scanning-maintainer/scripts/secret-scanning.mjs
20+
```
21+
22+
The script enforces:
23+
24+
- `hide_secret=true` on all alert fetches (no plaintext secrets in stdout)
25+
- `mktemp` with random UUIDs for all temp files
26+
- `-F body=@file` for all body uploads (no inline shell quoting)
27+
- Notification templates branched by location type
28+
- Never prints `.secret` or `.body` to stdout
29+
30+
## Overall Flow
31+
32+
Supports single or multiple alerts. For multiple alerts, process in ascending order.
33+
34+
For each alert:
35+
36+
1. **Identify**`fetch-alert` + `fetch-content` to get metadata and body
37+
2. **Decide** — Agent reads the body file, identifies all secrets, produces redacted version
38+
3. **Redact**`redact-body` for issue/PR body; skip for comments (delete directly)
39+
4. **Purge**`delete-comment` + `recreate-comment` for comments; cannot purge body history
40+
5. **Notify**`notify` posts the right template per location type
41+
6. **Resolve**`resolve` closes the alert
42+
7. **Summary**`summary` prints formatted results
43+
44+
## Step 1: Identify
45+
46+
```bash
47+
# List all open alerts
48+
node secret-scanning.mjs list-open
49+
50+
# Fetch specific alert metadata + locations
51+
node secret-scanning.mjs fetch-alert <NUMBER>
52+
53+
# Fetch content for each location (saves body to temp file)
54+
node secret-scanning.mjs fetch-content '<location-json>'
55+
```
56+
57+
The `fetch-content` output includes:
58+
59+
- `body_file`: path to temp file with full body content
60+
- `author`: who posted it
61+
- `issue_number` / `pr_number`: where it is
62+
- `edit_history_count`: number of existing edits
63+
- `type`: location type for routing
64+
65+
### Location type routing
66+
67+
| type | Flow |
68+
| ----------------------------- | ------------------------ |
69+
| `issue_comment` | Comment: delete+recreate |
70+
| `pull_request_comment` | Comment: delete+recreate |
71+
| `pull_request_review_comment` | Comment: delete+recreate |
72+
| `issue_body` | Body: redact in place |
73+
| `pull_request_body` | Body: redact in place |
74+
| `commit` | Notify only |
75+
| _other_ | Skip and report |
76+
77+
## Step 2: Decide (Agent)
78+
79+
The agent reads the body file from `fetch-content` output and:
80+
81+
1. Identifies ALL secrets in the content (there may be more than the alert flagged)
82+
2. Replaces each secret with `[REDACTED <secret_type>]`**no partial values, no prefix/suffix**
83+
3. Saves the redacted content to a new temp file
84+
85+
This is the only step that requires semantic understanding. Everything else is mechanical.
86+
87+
## Step 3: Redact
88+
89+
### For comments (issue_comment / PR comments)
90+
91+
**Do NOT redact.** Skip directly to Step 4 (delete + recreate). PATCHing before DELETE creates an unnecessary edit history revision.
92+
93+
### For issue_body / pull_request_body
94+
95+
```bash
96+
node secret-scanning.mjs redact-body <issue|pr> <NUMBER> <redacted-body-file>
97+
```
98+
99+
## Step 4: Purge Edit History
100+
101+
### Comments — Delete and Recreate
102+
103+
```bash
104+
# Delete original (all edit history gone)
105+
node secret-scanning.mjs delete-comment <COMMENT_ID>
106+
107+
# Recreate with redacted content
108+
# Agent prepares the body file with maintainer header + redacted content
109+
node secret-scanning.mjs recreate-comment <ISSUE_NUMBER> <body-file>
110+
```
111+
112+
The recreated comment should follow this format:
113+
114+
```
115+
> **Note from maintainer (@<LOGIN>):** The original comment by @<AUTHOR> has been removed due to secret leakage. Below is the redacted version of the original content.
116+
117+
---
118+
119+
<redacted original content>
120+
```
121+
122+
### issue_body / pull_request_body — Cannot Purge
123+
124+
Editing creates an edit history revision with the pre-edit plaintext. This cannot be cleared via API.
125+
126+
**Output to maintainer terminal only (never in public comments):**
127+
128+
```
129+
⚠️ Issue/PR body edit history still contains plaintext secrets.
130+
Contact GitHub Support to purge: https://support.github.com/contact
131+
Request purge of issue/PR #{NUMBER} userContentEdits.
132+
```
133+
134+
> **CRITICAL:** Do NOT mention edit history or the "edited" button in any public comment or resolution_comment.
135+
136+
### Commits
137+
138+
Cannot clean. Notify author to delete branch or force-push (for unmerged PRs).
139+
140+
## Step 5: Notify
141+
142+
```bash
143+
node secret-scanning.mjs notify <ISSUE_NUMBER> <AUTHOR> <LOCATION_TYPE> <SECRET_TYPES>
144+
```
145+
146+
Secret types are comma-separated: `"Discord Bot Token,Feishu App Secret"`
147+
148+
The script picks the right template:
149+
150+
- **comment types**: "your comment … removed and replaced"
151+
- **body types**: "your issue/PR description … redacted in place"
152+
- **commit**: "code you committed"
153+
154+
## Step 6: Resolve
155+
156+
```bash
157+
node secret-scanning.mjs resolve <ALERT_NUMBER>
158+
# or with custom resolution:
159+
node secret-scanning.mjs resolve <ALERT_NUMBER> revoked "Custom comment"
160+
```
161+
162+
Resolution is `revoked` by default. As maintainers we cannot control whether users rotate — our responsibility is to redact + notify. The `revoked` means "this secret should be considered leaked", not "I confirmed it was revoked".
163+
164+
## Step 7: Summary
165+
166+
After processing, create a JSON results file and pass it to the summary command:
167+
168+
```bash
169+
node secret-scanning.mjs summary /tmp/results.json
170+
```
171+
172+
The script outputs a block delimited by `---BEGIN SUMMARY---` and `---END SUMMARY---`. **You MUST output the content between these markers verbatim to the user. Do NOT rephrase, reformat, abbreviate, or create your own summary.** The script already includes full URLs for every alert and location.
173+
174+
The JSON format:
175+
176+
```json
177+
[
178+
{
179+
"number": 72,
180+
"secret_type": "Discord Bot Token",
181+
"location_label": "Issue #63101 comment",
182+
"location_url": "https://github.com/openclaw/openclaw/issues/63101#issuecomment-xxx",
183+
"actions": "Deleted+Recreated+Notified",
184+
"history_cleared": true
185+
}
186+
]
187+
```
188+
189+
For unsupported types, add `"skipped": true, "unsupported_type": "<type>"`.
190+
191+
## Safety Rules
192+
193+
- **Agent reads content, identifies secrets, produces redaction.** Script handles all API calls.
194+
- **Never include any portion of a secret** in public comments, redaction markers, or terminal output.
195+
- **Never include alert URLs or numbers** in public comments.
196+
- **For comments, skip PATCH — go directly to DELETE + recreate.**
197+
- **Never mention edit history, "edited" button, or commit SHAs** in any public content.
198+
- **Ask for confirmation** before deleting any comment.
199+
- **One alert at a time** unless user requests batch.
200+
- **All public comments in English.**
201+
- **Skip unsupported location types** and report in summary.

0 commit comments

Comments
 (0)