mirror of
https://github.com/Heretek-AI/opencode-v2-plugin-teser.git
synced 2026-11-08 08:07:13 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dfc6f6a526 | ||
|
|
2fe0ba871f | ||
|
|
bd36c293c2 | ||
|
|
b9bc7ccf23 | ||
|
|
2245c87a8e |
No files matched your search
@@ -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
|
||||
@@ -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
|
||||
@@ -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
@@ -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,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");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user