From 250ede03f822556fd5013bd9eaad460df56e8541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=B1=B3=E6=96=AF=E7=89=B9=E6=8A=98=E8=85=BE?= <814442321@qq.com> Date: Sun, 6 Sep 2026 11:53:44 +0800 Subject: [PATCH 1/4] chore(ci): restrict npm publish to main-branch releases 1. Add target_commitish == 'main' guard to the publish job so releases cut from dev are skipped 2. Dev-branch pushes remain non-triggering (workflow only listens to release published) --- .github/workflows/publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a96d7f0..ff51f40 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,6 +9,8 @@ permissions: jobs: publish: + # [2026-09-06]-[only main-branch releases may publish to npm; dev-branch releases are ignored]-[prevents accidental npm publish from dev] + if: github.event.release.target_commitish == 'main' runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 From f08a99e2b8422768e0862b6df4917249323357c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=B1=B3=E6=96=AF=E7=89=B9=E6=8A=98=E8=85=BE?= <814442321@qq.com> Date: Sun, 6 Sep 2026 11:53:49 +0800 Subject: [PATCH 2/4] chore: remove oh-my-opencode-slim clonedeps cache 1. Delete .slim/ cloned opencode repo and clonedeps.json manifest (dev-only reference, unused at build time) 2. Drop the matching .gitignore block and the now-empty .ignore --- .gitignore | 3 --- .ignore | 9 --------- .slim/clonedeps.json | 15 --------------- 3 files changed, 27 deletions(-) delete mode 100644 .ignore delete mode 100644 .slim/clonedeps.json diff --git a/.gitignore b/.gitignore index dc3bf51..b837cf6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,3 @@ node_modules/ dist/ *.tgz .switchman/ -# BEGIN oh-my-opencode-slim clonedeps -.slim/clonedeps/repos/ -# END oh-my-opencode-slim clonedeps diff --git a/.ignore b/.ignore deleted file mode 100644 index 32dbf4f..0000000 --- a/.ignore +++ /dev/null @@ -1,9 +0,0 @@ -# BEGIN oh-my-opencode-slim clonedeps -!.slim/ -!.slim/clonedeps.json -!.slim/clonedeps/ -!.slim/clonedeps/repos/ -!.slim/clonedeps/repos/** -.slim/clonedeps/repos/**/.git/ -.slim/clonedeps/repos/**/.git/** -# END oh-my-opencode-slim clonedeps diff --git a/.slim/clonedeps.json b/.slim/clonedeps.json deleted file mode 100644 index bba2163..0000000 --- a/.slim/clonedeps.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": "1.0.0", - "updatedAt": "2026-08-29T10:43:44.002639+08:00", - "dependencies": [ - { - "name": "@opencode-ai/plugin", - "resolvedVersion": "dev (HEAD dc4449d)", - "repoUrl": "https://github.com/anomalyco/opencode.git", - "ref": "dc4449df0d52199704ea4989a5a993ebbc605612", - "path": ".slim/clonedeps/repos/anomalyco__opencode", - "packagePath": "packages/plugin", - "reason": "Plugin API source; plus monorepo internals (core/tui/app) for matrix-dynamic feature research" - } - ] -} From 6d63f694e4facb5856576fac6c87ffc8ca6850b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=B1=B3=E6=96=AF=E7=89=B9=E6=8A=98=E8=85=BE?= <814442321@qq.com> Date: Sun, 6 Sep 2026 12:06:57 +0800 Subject: [PATCH 3/4] ci: add PR gate workflow and code-owner rule for main 1. Add CI workflow (typecheck, unit tests, build) with a build gate that fails on any warning or error output 2. Add CODEOWNERS mapping all paths to the repository owner for review enforcement --- .github/CODEOWNERS | 2 ++ .github/workflows/ci.yml | 58 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/ci.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..4b6c1e5 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# Default: repository owner reviews every change (paired with the main-branch ruleset's code-owner review requirement). +* @mrzturn diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..04c541f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,58 @@ +name: CI + +# [2026-09-06]-[PR gate for main: typecheck + unit tests + warning-free build; checks are required by the main-branch ruleset]-[blocks merges that fail typecheck/tests/build or emit build warnings] +on: + pull_request: + branches: [main] + push: + branches: [main] + +permissions: + contents: read + +jobs: + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + + - uses: oven-sh/setup-bun@v2 + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Typecheck + run: bun run typecheck + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + + - uses: oven-sh/setup-bun@v2 + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Unit tests + run: bun test + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + + - uses: oven-sh/setup-bun@v2 + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Build without errors or warnings + run: | + set -o pipefail + bun run build 2>&1 | tee /tmp/build.log + if grep -qiE 'warn(ing)?|error' /tmp/build.log; then + echo "::error::build output contains warnings or errors" + grep -inE 'warn(ing)?|error' /tmp/build.log + exit 1 + fi From cde46c55b258afe196ac6b8619f2360b7def4aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=B1=B3=E6=96=AF=E7=89=B9=E6=8A=98=E8=85=BE?= <814442321@qq.com> Date: Sun, 6 Sep 2026 15:55:44 +0800 Subject: [PATCH 4/4] ci: drop push trigger so required check names match PR check runs --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04c541f..b933935 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,8 +4,6 @@ name: CI on: pull_request: branches: [main] - push: - branches: [main] permissions: contents: read