CI: add ClawHub plugin release workflow#59179
Conversation
🔒 Aisle Security AnalysisWe found 2 potential security issue(s) in this PR:
1. 🟠 Unpinned external repository checkout executed in OIDC-enabled release workflow (supply-chain RCE)
DescriptionThe release workflow fetches and executes code from an external repository ( This creates a supply-chain risk:
Vulnerable code (external checkout + execution in OIDC job): permissions:
contents: read
id-token: write
...
- name: Checkout ClawHub CLI source
uses: actions/checkout@v6
with:
repository: ${{ env.CLAWHUB_REPOSITORY }}
ref: ${{ env.CLAWHUB_REF }}
...
- name: Bootstrap ClawHub CLI
run: |
exec bun "$GITHUB_WORKSPACE/clawhub-source/packages/clawdhub/src/cli.ts" "$@"RecommendationPin and verify the external dependency used for publishing. Recommended options (in order of strength):
env:
CLAWHUB_REPOSITORY: openclaw/clawhub
CLAWHUB_REF: <FULL_COMMIT_SHA>
- name: Checkout ClawHub CLI source
uses: actions/checkout@v6
with:
repository: ${{ env.CLAWHUB_REPOSITORY }}
ref: ${{ env.CLAWHUB_REF }}
path: clawhub-source
fetch-depth: 1
Additionally, consider pinning uses: actions/checkout@<pinned_sha>2. 🟠 GitHub Actions supply-chain RCE via `bun install` on external repo in OIDC-enabled release workflow
DescriptionThe workflow checks out an external repository ( Impact:
This creates a high-impact supply-chain/RCE surface, especially since the external repo is checked out from a moving ref ( Vulnerable code: - name: Checkout ClawHub CLI source
uses: actions/checkout@v6
with:
repository: ${{ env.CLAWHUB_REPOSITORY }}
ref: ${{ env.CLAWHUB_REF }}
path: clawhub-source
- name: Install ClawHub CLI dependencies
working-directory: clawhub-source
run: bun install --frozen-lockfileRecommendationMitigate install-time script execution and reduce trust/privilege:
- name: Install ClawHub CLI dependencies (no scripts)
working-directory: clawhub-source
run: bun install --frozen-lockfile --ignore-scriptsIf the CLI requires build steps, prefer running explicit, audited build commands rather than arbitrary dependency scripts.
env:
CLAWHUB_REF: "<pinned-commit-sha>"
Analyzed PR: #59179 at commit Last updated on: 2026-04-01T19:16:17Z Latest run failed. Keeping previous successful results. Trace ID: Last updated on: 2026-04-02T09:08:40Z |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ee702444d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Greptile SummaryThis PR introduces a complete ClawHub plugin registry release pipeline: a GitHub Actions workflow ( Key highlights:
Confidence Score: 5/5
Prompt To Fix All With AIThis is a comment left during a code review.
Path: .github/workflows/plugin-clawhub-release.yml
Line: 200
Comment:
**Direct context interpolation of matrix value into shell**
`${{ matrix.plugin.packageDir }}` is interpolated directly into the `run` block, which is against GitHub's [security hardening guidance](https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable) for untrusted context values. While `packageDir` is derived from the repository's own `extensions/` directory names (low practical risk), the same pattern repeated at line 269 (in the real publish step) should be addressed to follow best practices.
The recommended fix is to pass it through an environment variable so the shell receives it as an already-evaluated string rather than an inline expression:
```suggestion
env:
CLAWHUB_REGISTRY: ${{ env.CLAWHUB_REGISTRY }}
SOURCE_REPO: ${{ github.repository }}
SOURCE_COMMIT: ${{ needs.preview_plugins_clawhub.outputs.ref_sha }}
SOURCE_REF: ${{ github.ref }}
PACKAGE_DIR: ${{ matrix.plugin.packageDir }}
run: bash scripts/plugin-clawhub-publish.sh --dry-run "${PACKAGE_DIR}"
```
The same change should be applied to the `Publish` step at line 269.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: .github/workflows/plugin-clawhub-release.yml
Line: 254-261
Comment:
**Already-published guard only checks HTTP 200, not all 2xx**
The guard only treats `200` as "already published" and treats any other non-`404` status as an unexpected error that aborts. Meanwhile `isPluginVersionPublishedOnClawHub` in `scripts/lib/plugin-clawhub-release.ts` uses `response.ok` (all 2xx statuses) for the same semantic. If ClawHub's API ever returns a `201` or `204` for an existing package (e.g., after a format migration), this shell guard would abort with "Unexpected ClawHub response" instead of the intended idempotency error, and the mismatch between the two code paths could cause confusing failures.
Consider aligning the check with the TypeScript logic:
```suggestion
if [[ "${status}" =~ ^2 ]]; then
echo "${PACKAGE_NAME}@${PACKAGE_VERSION} is already published on ClawHub."
exit 1
fi
if [[ "${status}" != "404" ]]; then
echo "Unexpected ClawHub response (${status}) for ${PACKAGE_NAME}@${PACKAGE_VERSION}."
exit 1
fi
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "CI: add ClawHub plugin release workflow" | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3bab22e87c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 468b87884d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fea4c0acb9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 27328eac61
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Follow-up on the bot summary comments:
One remaining caveat from the Aisle comment is real: this workflow still checks out |
|
Final maintainer note: What changed
Local validation
Notes
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 044f49b209
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Follow-up is done. Latest fix:
Validation:
Current PR state:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a8ba66d9d9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if [[ "${candidate_count}" != "0" ]]; then | ||
| has_candidates="true" | ||
| fi | ||
| matrix_json="$(jq -c '.candidates' .local/plugin-clawhub-release-plan.json)" |
There was a problem hiding this comment.
Use full selection for push preview dry-runs
The preview matrix is sourced from .candidates (only not-yet-published versions), and preview_plugin_pack is skipped when that list is empty, so a push that changes shared release tooling can go green without running any dry-run package publish once existing plugin versions are already on ClawHub; that leaves regressions in the publish path undiscovered until a later manual release. Fresh evidence relative to the earlier “shared-input fanout” thread is that this line still narrows the matrix to .candidates rather than the selected .all set.
Useful? React with 👍 / 👎.
a8ba66d to
6e557bc
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6e557bc64d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| - main | ||
| paths: | ||
| - ".github/workflows/plugin-clawhub-release.yml" | ||
| - ".github/actions/setup-node-env/**" |
There was a problem hiding this comment.
Track setup-pnpm-store-cache changes in push trigger
Add .github/actions/setup-pnpm-store-cache/** to this workflow’s on.push.paths. I checked .github/actions/setup-node-env/action.yml and that composite action delegates to ./.github/actions/setup-pnpm-store-cache; with the current allowlist, edits to that helper won’t trigger plugin-clawhub-release.yml, so environment/setup regressions in the release path can merge without this workflow running.
Useful? React with 👍 / 👎.
* CI: add ClawHub plugin release workflow * CI: harden ClawHub plugin release workflow * CI: finish ClawHub plugin release hardening * CI: watch shared ClawHub release inputs * CI: harden ClawHub publish workflow * CI: watch more ClawHub release deps * CI: match shared release inputs by prefix * CI: pin ClawHub publish source commit * CI: refresh pinned ClawHub release commit * CI: rename ClawHub plugin release environment --------- Co-authored-by: Onur Solmaz <[email protected]>
* CI: add ClawHub plugin release workflow * CI: harden ClawHub plugin release workflow * CI: finish ClawHub plugin release hardening * CI: watch shared ClawHub release inputs * CI: harden ClawHub publish workflow * CI: watch more ClawHub release deps * CI: match shared release inputs by prefix * CI: pin ClawHub publish source commit * CI: refresh pinned ClawHub release commit * CI: rename ClawHub plugin release environment --------- Co-authored-by: Onur Solmaz <[email protected]>
* CI: add ClawHub plugin release workflow * CI: harden ClawHub plugin release workflow * CI: finish ClawHub plugin release hardening * CI: watch shared ClawHub release inputs * CI: harden ClawHub publish workflow * CI: watch more ClawHub release deps * CI: match shared release inputs by prefix * CI: pin ClawHub publish source commit * CI: refresh pinned ClawHub release commit * CI: rename ClawHub plugin release environment --------- Co-authored-by: Onur Solmaz <[email protected]>
* CI: add ClawHub plugin release workflow * CI: harden ClawHub plugin release workflow * CI: finish ClawHub plugin release hardening * CI: watch shared ClawHub release inputs * CI: harden ClawHub publish workflow * CI: watch more ClawHub release deps * CI: match shared release inputs by prefix * CI: pin ClawHub publish source commit * CI: refresh pinned ClawHub release commit * CI: rename ClawHub plugin release environment --------- Co-authored-by: Onur Solmaz <[email protected]>
* CI: add ClawHub plugin release workflow * CI: harden ClawHub plugin release workflow * CI: finish ClawHub plugin release hardening * CI: watch shared ClawHub release inputs * CI: harden ClawHub publish workflow * CI: watch more ClawHub release deps * CI: match shared release inputs by prefix * CI: pin ClawHub publish source commit * CI: refresh pinned ClawHub release commit * CI: rename ClawHub plugin release environment --------- Co-authored-by: Onur Solmaz <[email protected]>
Summary
openclaw.release.publishToClawHub: trueTesting
Notes