Skip to content

ci: verify automated plugin update commits - #160

Merged
mynameistito merged 3 commits into
mainfrom
feat/verified-opencode-plugin-updates
Oct 2, 2026
Merged

mynameistito merged 3 commits into
mainfrom
feat/verified-opencode-plugin-updates

Conversation

@mynameistito

@mynameistito mynameistito commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

The plugin update workflow currently creates commits with git commit, which GitHub doesn’t automatically verify. This changes it to create the commit through GitHub’s API using the workflow’s existing token.

The script checks GitHub’s verification result before updating the update branch, so an unsigned commit won’t be pushed. No extra app credentials or signing keys are needed.

Checks: bun run typecheck, bunx ultracite check, and git diff --check.


Summary by cubic

The plugin update workflow now creates commits through GitHub's API instead of git commit, so GitHub verifies every commit before it's pushed.

The script only updates the update-opencode-plugin branch when GitHub reports the commit as verified, and no extra signing keys or app credentials are needed.

  • Fails clearly when the GraphQL branch update reports errors instead of silently ignoring them.

Written for commit c50291a. Summary will update on new commits.

Review in cubic

@changeset-bot

changeset-bot Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c50291a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: bb8c7e1e-0dc6-4973-8f41-d1ae17e7bf6f

📥 Commits

Reviewing files that changed from the base of the PR and between 4cb12b6 and c50291a.

📒 Files selected for processing (2)
  • .github/workflows/update-opencode-plugin.yml
  • scripts/create-signed-github-commit.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Chores
    • Automated plugin updates now publish commits that GitHub marks as verified. Updates are based on the current main revision and include the relevant version information and change notes.
    • The update branch advances only when commit creation and publication succeed; unverified commits or failed publication stop the update.

Walkthrough

The workflow records the current main commit SHA and delegates update commit creation to a new script. The script creates a verified commit from package and Changesets files, then updates the update-opencode-plugin branch through GitHub APIs.

Changes

Verified update commit flow

Layer / File(s) Summary
Workflow inputs and API requests
.github/workflows/update-opencode-plugin.yml, scripts/create-signed-github-commit.ts
The workflow records the main commit SHA and passes it, the package version, and the GitHub token to the script. The script validates required environment variables and GitHub API responses.
Create a verified update commit
scripts/create-signed-github-commit.ts
The script reads package.json, bun.lock, and top-level Changesets Markdown files. It creates a tree on the main commit and creates a versioned commit. It stops if required SHAs are missing or GitHub does not mark the commit verified.
Update the branch ref
scripts/create-signed-github-commit.ts
The script looks up the update branch and repository node ID. It updates the branch with the verified commit and checks the GraphQL response before logging the commit SHA.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant UpdateWorkflow
  participant CreateSignedCommitScript
  participant GitHubREST
  participant GitHubGraphQL
  UpdateWorkflow->>CreateSignedCommitScript: Pass MAIN_SHA, VERSION, and GH_TOKEN
  CreateSignedCommitScript->>GitHubREST: Fetch base commit and create tree and commit
  GitHubREST-->>CreateSignedCommitScript: Return commit SHA and verification status
  CreateSignedCommitScript->>GitHubREST: Look up update branch ref and repository node ID
  GitHubREST-->>CreateSignedCommitScript: Return ref SHA if present
  CreateSignedCommitScript->>GitHubGraphQL: Update update-opencode-plugin to the verified commit SHA
  GitHubGraphQL-->>CreateSignedCommitScript: Return updateRefs result
Loading

Merge Risk: ⚪ Minimal · up to c5029

The workflow can create the update branch and include the files generated by a normal plugin update. No merge-blocking issue is established; merge after the usual checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to c5029

The change adds a verification gate without expanding repository permissions or exposing a new public endpoint. Risk is bounded to the automated update branch. However, capturing that branch’s expected head later in the workflow weakens protection against corrective edits made while an update is being prepared.

Retained concerns

  • Low · reliability · inferred: The expected update-branch head is now captured after update preparation and verified-commit creation. An authorized writer’s corrective or rollback commit made during that preparation can be accepted as beforeOid and then replaced by the main-based update commit. Previously, the earlier force-with-lease snapshot would reject that intervening change. Workflow concurrency protects its own runs but does not protect external branch writers.
Security review details

Security Blast Radius

  • inferred — The implemented mutation targets only update-opencode-plugin in the workflow repository, followed by pull-request operations rather than direct main publication. The token nevertheless carries repository contents-write and pull-request-write authority, so credential compromise could exceed that single branch. These permission scopes are unchanged by this PR.

Security Findings and Attack Paths

  • inferred — No introduced path from npm version metadata to repository selection, branch selection, or token identity was established. The external version influences dependency content and commit metadata; GitHub verification does not establish the safety of that dependency. Npm discovery and installation were already part of the base workflow.

Trust Boundaries and Controls

  • observed — GitHub Actions supplies the existing token and repository context; the script sends bearer-authenticated requests to GitHub’s fixed API hosts. Verification gates publication, and HTTP failures, GraphQL errors, or a missing updateRefs result cause the script to fail.

Resilience and Maintainability Implications

  • inferred — Serialized workflow runs reduce self-races, and verification failure leaves the branch unpublished. They do not prevent other authorized writers from changing the branch during preparation, which is the bounded ownership and rollback concern identified here.

Hardening Proposals

  • proposed — Preserve the earlier expected-head snapshot across update preparation and pass it into publication, retaining the prior protection for corrective edits made while the workflow is running.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the workflow change and lists validation commands, but it omits required template sections for the related issue, OpenCode and plugin compatibility, structured validation chec… Add all required template sections. Include a Related issue entry, state "Not applicable" under OpenCode and plugin compatibility because this is tooling-only, record validation results in the template checklist, and complete the Release se…
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: verifying automated plugin update commits.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the workflow change and lists validation commands, but it omits required template sections for the related issue, OpenCode and plugin compatibility, structured validation checkboxes, and release information.

Resolution

Add all required template sections. Include a Related issue entry, state "Not applicable" under OpenCode and plugin compatibility because this is tooling-only, record validation results in the template checklist, and complete the Release section.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the main SHA at dawn,
Then gathers leaves where changes are drawn.
A signed commit takes shape with care,
The branch points to its new mark there.
The rabbit hops, the checks all green,
And tucks a carrot by the screen.

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added github-actions Automatically managed pull request metadata size/m Automatically managed pull request metadata labels Oct 2, 2026
@codecov

codecov Bot commented Oct 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Deploying with Alchemy Alchemy

The latest deployment for this pull request.

Status Name Latest commit Updated (UTC)
Deployment successful
View Cloudflare logs
opencode-plugins-docs-pr-160 c50291a9 2026-10-02T07:40:36.932Z

Diagnostics: View GitHub Actions run

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread scripts/create-signed-github-commit.ts
Comment thread .github/workflows/update-opencode-plugin.yml Outdated
Comment thread scripts/create-signed-github-commit.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread scripts/create-signed-github-commit.ts Outdated
@mynameistito
mynameistito merged commit 2a46821 into main Oct 2, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github-actions Automatically managed pull request metadata size/m Automatically managed pull request metadata

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant