5 Commits
Author SHA1 Message Date
BillyOutlast dfc6f6a526 ci(ocr): point review job at org reusable workflow (pinned)
Fix 'failed to fetch workflow' parse error: ocr.yml referenced a local reusable workflow path (./.github/workflows/ocr-review.yml) that does not exist in this repo. Point at Heretek-AI/.github org reusable workflow pinned to main HEAD (a440b485).
2026-10-19 16:34:24 -04:00
BillyOutlast 2fe0ba871f ci: add reusable OpenCodeReview PR workflow 2026-10-19 15:49:43 -04:00
John Smith bd36c293c2 ci: require npm >= 11.5 for OIDC trusted publishing 2026-10-18 22:32:58 -04:00
John Smith b9bc7ccf23 chore: bump to 0.1.1 2026-10-18 22:15:42 -04:00
John Smith 2245c87a8e ci: add OIDC trusted-publishing workflow for npm
Publishes @heretek-ai/opencode-plugin-ci on full semver tags (v*.*.*)
via npm OIDC trusted publishing with provenance. Gates on
bun run check and a tag-vs-package.json version guard.
2026-10-18 21:38:49 -04:00
5 changed files with 80 additions and 10 deletions

No files matched your search

+41
View File
@@ -0,0 +1,41 @@
name: OpenCodeReview
concurrency:
group: >-
${{
(
github.event_name == 'pull_request_target'
|| (
github.event_name == 'issue_comment'
&& github.event.issue.pull_request
&& github.event.comment.user.type != 'Bot'
&& (
github.event.comment.author_association == 'MEMBER'
|| github.event.comment.author_association == 'OWNER'
|| github.event.comment.author_association == 'COLLABORATOR'
)
&& (
startsWith(github.event.comment.body, '/open-code-review')
|| startsWith(github.event.comment.body, '@open-code-review')
)
)
)
&& format('ocr-{0}', github.event.pull_request.number || github.event.issue.number)
|| format('noop-{0}', github.run_id)
}}
cancel-in-progress: true
on:
pull_request_target:
types: [opened, synchronize, reopened]
issue_comment:
types: [created]
permissions:
contents: read
pull-requests: write
jobs:
review:
uses: Heretek-AI/.github/.github/workflows/ocr-review.yml@a440b485d779b9177b1602c4d4f7f58cff0483a2 # main
secrets: inherit
+32
View File
@@ -0,0 +1,32 @@
name: publish
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: read
id-token: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v7
with:
node-version: 22
registry-url: https://registry.npmjs.org
- name: Upgrade npm for OIDC trusted publishing (requires npm >= 11.5)
run: npm install -g npm@latest
- run: bun install --frozen-lockfile
- run: bun run check
- name: Verify tag matches package.json version
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
PKG_VERSION="$(node --input-type=module -e "import { readFileSync } from 'node:fs'; console.log(JSON.parse(readFileSync('package.json', 'utf8')).version)")"
if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
echo "Refusing to publish: tag ${GITHUB_REF_NAME} (version ${TAG_VERSION}) does not match package.json version ${PKG_VERSION}" >&2
exit 1
fi
echo "Publishing version ${PKG_VERSION} from tag ${GITHUB_REF_NAME}"
- run: npm publish --provenance --access public
+4 -7
View File
@@ -28,13 +28,10 @@ in [schema/config.json](schema/config.json) and
From your plugin repo root:
> **NOTE: the package is not published to npm yet** (`0.1.0` unpublished),
> so `bunx @heretek-ai/opencode-plugin-ci` 404s and the `$schema` URLs below
> 404 too (editor schema assistance stays dead until publish). Until the
> first publish, run the CLI from a source checkout: below,
> `<checkout>` is your clone of this repo, and
> `bun <checkout>/bin/opencode-plugin-ci.ts ...` takes the place of
> `bunx @heretek-ai/opencode-plugin-ci ...`.
> **NOTE:** the package is published as `@heretek-ai/opencode-plugin-ci`,
> so `bunx @heretek-ai/opencode-plugin-ci ...` works directly. To run from
> a source checkout instead, `<checkout>` below is your clone of this repo, and
> `bun <checkout>/bin/opencode-plugin-ci.ts ...` takes the place of `bunx ...`.
```sh
# 1. Scaffold starter files (.opencode-ci/config.yaml + an example scenario).
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@heretek-ai/opencode-plugin-ci",
"version": "0.1.0",
"version": "0.1.1",
"description": "Verify opencode v2 plugins actually work, locally and in GitHub Actions",
"license": "MIT",
"type": "module",
+2 -2
View File
@@ -2,7 +2,7 @@ import { describe, expect, test } from "bun:test";
import { main } from "../../src/cli.ts";
describe("cli --version", () => {
test("prints 0.1.0 and returns 0", async () => {
test("prints 0.1.1 and returns 0", async () => {
const lines: string[] = [];
const origLog = console.log;
console.log = (...args: unknown[]) => {
@@ -14,6 +14,6 @@ describe("cli --version", () => {
} finally {
console.log = origLog;
}
expect(lines.join("\n")).toContain("0.1.0");
expect(lines.join("\n")).toContain("0.1.1");
});
});