mirror of
https://github.com/Heretek-AI/opencode-v2-plugin-teser.git
synced 2026-11-07 11:05:59 -10:00
R1: remove gate.artifact multi-version guard (schema superRefine), delete artifact-guard test, docs to recommendation (README+SPEC). R2: collectSecretValues returns only live.keys, MIN 4->8, scrub JSON-escaped form; update evidence-scrub tests. R3: action.yml resolved-dir guard (pwd -P vs GITHUB_WORKSPACE), result=fail on reject, allow absolute-inside; update action-working-dir tests + README/SPEC. Triad: programmer->QA PASS (316 pass)->Drift Guard VERDICT:PASS
73 lines
3.1 KiB
YAML
73 lines
3.1 KiB
YAML
name: opencode plugin CI
|
|
description: Verify an opencode v2 plugin actually works
|
|
branding: { icon: check-circle, color: green }
|
|
inputs:
|
|
tiers:
|
|
description: "Comma-separated: load,scripted,live"
|
|
default: "load,scripted,live"
|
|
opencode-versions:
|
|
description: "Overrides config, comma-separated"
|
|
default: ""
|
|
working-directory:
|
|
description: "Plugin repo directory; must stay inside GITHUB_WORKSPACE (absolute paths inside the workspace are fine)"
|
|
default: "."
|
|
upload-artifact:
|
|
description: "Upload evidence + results"
|
|
default: "true"
|
|
artifact-name:
|
|
description: "Artifact name for evidence + results. The gate also reads history from this name, so use a distinct name per matrix leg."
|
|
default: "opencode-plugin-ci-results"
|
|
outputs:
|
|
result:
|
|
description: "pass | fail"
|
|
value: ${{ steps.run.outputs.result }}
|
|
report-path:
|
|
description: "Path to report.md"
|
|
value: ${{ steps.run.outputs.report-path }}
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- uses: oven-sh/setup-bun@v2
|
|
- uses: actions/setup-node@v7
|
|
with: { node-version: 22 }
|
|
- name: Install tool dependencies
|
|
shell: bash
|
|
working-directory: ${{ github.action_path }}
|
|
run: bun install --frozen-lockfile
|
|
- id: run
|
|
shell: bash
|
|
working-directory: ${{ inputs.working-directory }}
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
# Inputs go through env, never interpolated into the script (prevents script injection).
|
|
IN_TIERS: ${{ inputs.tiers }}
|
|
IN_VERSIONS: ${{ inputs.opencode-versions }}
|
|
IN_ARTIFACT: ${{ inputs.artifact-name }}
|
|
IN_WD: ${{ inputs.working-directory }}
|
|
ACTION_PATH: ${{ github.action_path }}
|
|
run: |
|
|
# OCI-6.3-working-dir: working-directory must stay inside the
|
|
# workspace. The step has already changed into working-directory,
|
|
# so $PWD is the resolved path; compare it against the resolved
|
|
# workspace root. Absolute paths inside the workspace are fine.
|
|
# Checked via env passthrough to keep the zero-interpolation invariant.
|
|
ws="$(cd "$GITHUB_WORKSPACE" && pwd -P)"
|
|
case "$(pwd -P)/" in "$ws"/*) ;; *) echo "working-directory must be inside the workspace (got: $IN_WD)" >&2; echo "result=fail" >> "$GITHUB_OUTPUT"; exit 2;; esac
|
|
args=()
|
|
IFS=',' read -ra T <<< "$IN_TIERS"; for t in "${T[@]}"; do args+=(--tier "$t"); done
|
|
if [ -n "$IN_VERSIONS" ]; then IFS=',' read -ra V <<< "$IN_VERSIONS"; for v in "${V[@]}"; do args+=(--opencode "$v"); done; fi
|
|
args+=(--gate-artifact "$IN_ARTIFACT")
|
|
set +e
|
|
bun "$ACTION_PATH/bin/opencode-plugin-ci.ts" run "${args[@]}" --out .opencode-ci/out
|
|
code=$?
|
|
set -e
|
|
echo "report-path=$PWD/.opencode-ci/out/report.md" >> "$GITHUB_OUTPUT"
|
|
if [ $code -eq 0 ]; then echo "result=pass" >> "$GITHUB_OUTPUT"; else echo "result=fail" >> "$GITHUB_OUTPUT"; fi
|
|
exit $code
|
|
- if: always() && inputs.upload-artifact == 'true'
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: ${{ inputs.artifact-name }}
|
|
path: ${{ inputs.working-directory }}/.opencode-ci/out
|
|
if-no-files-found: ignore
|