Skip to content
Merged
2 changes: 2 additions & 0 deletions .github/workflows/doc-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
fetch-depth: 0

- uses: activadee/open-workflows/actions/doc-sync@main
with:
model: 'opencode/big-pickle'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENCODE_AUTH: ${{ secrets.OPENCODE_AUTH }}
2 changes: 2 additions & 0 deletions .github/workflows/issue-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
- uses: actions/checkout@v4

- uses: activadee/open-workflows/actions/issue-label@main
with:
model: 'opencode/big-pickle'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENCODE_AUTH: ${{ secrets.OPENCODE_AUTH }}
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ bun run test # Run tests
**AI-powered actions:**
```yaml
- uses: activadee/open-workflows/actions/pr-review@main
with:
variants: UNDEFINED # Optional OpenCode variants setting
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENCODE_AUTH: ${{ secrets.OPENCODE_AUTH }} # or ANTHROPIC_API_KEY
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: activadee/open-workflows/actions/pr-review@main
with:
variants: UNDEFINED
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
Expand Down Expand Up @@ -95,6 +97,7 @@ jobs:
- uses: activadee/open-workflows/actions/changeset@main
with:
mode: commit # or 'comment' to suggest via PR comment
variants: UNDEFINED
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
Expand Down Expand Up @@ -127,6 +130,10 @@ Or manually set the secret:
gh secret set OPENCODE_AUTH < ~/.local/share/opencode/auth.json
```

## Variants

AI actions accept an optional `variants` input to control OpenCode reasoning effort. Use `UNDEFINED` to omit the setting entirely.

## CLI Options

```bash
Expand Down
10 changes: 9 additions & 1 deletion actions/changeset/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ inputs:
description: 'Operation mode: commit (auto-commit changeset) or comment (suggest via PR comment)'
required: false
default: 'commit'
variants:
description: 'Optional OpenCode variants setting (e.g., reasoning effort). Set to UNDEFINED to omit.'
required: false
default: 'UNDEFINED'

runs:
using: 'composite'
Expand Down Expand Up @@ -40,7 +44,11 @@ runs:
- name: Generate Changeset
shell: bash
run: |
opencode run --model "${{ inputs.model }}" \
VARIANTS_ARG=()
if [ "${{ inputs.variants }}" != "UNDEFINED" ]; then
VARIANTS_ARG=(--variants "${{ inputs.variants }}")
fi
opencode run "${VARIANTS_ARG[@]}" --model "${{ inputs.model }}" \
"Load the changeset skill. Generate changeset for PR ${{ github.event.pull_request.number }} in mode: ${{ inputs.mode }}"
env:
GITHUB_TOKEN: ${{ github.token }}
4 changes: 4 additions & 0 deletions actions/changeset/skill.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ description: AI-powered changeset generation for monorepo releases. Analyzes PR
license: MIT
---

## Action Inputs

- `variants` (optional): OpenCode variants setting for reasoning effort. Use `UNDEFINED` to omit.

## What I Do

Analyze pull request changes and generate [Changesets](https://github.com/changesets/changesets) files that capture:
Expand Down
10 changes: 9 additions & 1 deletion actions/doc-sync/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ inputs:
description: 'Model to use for doc analysis'
required: false
default: 'anthropic/claude-sonnet-4-5'
variants:
description: 'Optional OpenCode variants setting (e.g., reasoning effort). Set to UNDEFINED to omit.'
required: false
default: 'UNDEFINED'

runs:
using: 'composite'
Expand Down Expand Up @@ -41,7 +45,11 @@ runs:
- name: Sync Documentation
shell: bash
run: |
opencode run --model "${{ inputs.model }}" \
VARIANTS_ARG=()
if [ "${{ inputs.variants }}" != "UNDEFINED" ]; then
VARIANTS_ARG=(--variants "${{ inputs.variants }}")
fi
opencode run "${VARIANTS_ARG[@]}" --model "${{ inputs.model }}" \
"Load the doc-sync skill and sync documentation for PR ${{ github.event.pull_request.number }}"
env:
GITHUB_TOKEN: ${{ github.token }}
4 changes: 4 additions & 0 deletions actions/doc-sync/skill.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ description: Keep documentation in sync with code changes. Analyzes PR diffs and
license: MIT
---

## Action Inputs

- `variants` (optional): OpenCode variants setting for reasoning effort. Use `UNDEFINED` to omit.

## What I Do

Analyze pull request changes and update documentation to reflect code changes. Uses native OpenCode tools (`write`, `bash`) for file operations and git commits.
Expand Down
10 changes: 9 additions & 1 deletion actions/issue-label/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ inputs:
description: 'Model to use for labeling'
required: false
default: 'anthropic/claude-haiku-4-5'
variants:
description: 'Optional OpenCode variants setting (e.g., reasoning effort). Set to UNDEFINED to omit.'
required: false
default: 'UNDEFINED'

runs:
using: 'composite'
Expand Down Expand Up @@ -36,7 +40,11 @@ runs:
- name: Label Issue
shell: bash
run: |
opencode run --model "${{ inputs.model }}" \
VARIANTS_ARG=()
if [ "${{ inputs.variants }}" != "UNDEFINED" ]; then
VARIANTS_ARG=(--variants "${{ inputs.variants }}")
fi
opencode run "${VARIANTS_ARG[@]}" --model "${{ inputs.model }}" \
"Load the issue-label skill. Label issue ${{ github.event.issue.number }}"
env:
GITHUB_TOKEN: ${{ github.token }}
4 changes: 4 additions & 0 deletions actions/issue-label/skill.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ description: Automatically apply appropriate labels to GitHub issues based on co
license: MIT
---

## Action Inputs

- `variants` (optional): OpenCode variants setting for reasoning effort. Use `UNDEFINED` to omit.

## What I Do

Analyze GitHub issue content and apply up to 3 appropriate labels to help maintainers triage and search issues effectively.
Expand Down
10 changes: 9 additions & 1 deletion actions/pr-review/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ inputs:
description: 'Model to use for review'
required: false
default: 'anthropic/claude-sonnet-4-5'
variants:
description: 'Optional OpenCode variants setting (e.g., reasoning effort). Set to UNDEFINED to omit.'
required: false
default: 'UNDEFINED'

runs:
using: 'composite'
Expand Down Expand Up @@ -36,7 +40,11 @@ runs:
- name: Review PR
shell: bash
run: |
opencode run --model "${{ inputs.model }}" \
VARIANTS_ARG=()
if [ "${{ inputs.variants }}" != "UNDEFINED" ]; then
VARIANTS_ARG=(--variants "${{ inputs.variants }}")
fi
opencode run "${VARIANTS_ARG[@]}" --model "${{ inputs.model }}" \
"Load the pr-review skill. Review PR ${{ github.event.pull_request.number }}"
env:
GITHUB_TOKEN: ${{ github.token }}
4 changes: 4 additions & 0 deletions actions/pr-review/skill.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ description: AI-powered pull request code review focusing on correctness, securi
license: MIT
---

## Action Inputs

- `variants` (optional): OpenCode variants setting for reasoning effort. Use `UNDEFINED` to omit.

## What I Do

Review pull request changes systematically and post findings as a sticky PR comment. Focus on **real issues that matter** - bugs, security risks, and stability problems that would block a merge in a typical code review.
Expand Down
1 change: 1 addition & 0 deletions scripts/apply-labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const ArgsSchema = z.object({
})
).optional().describe('New labels to create before applying'),
explanation: z.string().describe('Brief explanation of label choices'),
variants: z.string().optional().describe('Optional OpenCode variants setting (e.g., reasoning effort)'),
}).superRefine((value, ctx) => {
const labelCount = value.labels.length + (value.newLabels?.length ?? 0);

Expand Down
7 changes: 4 additions & 3 deletions scripts/write-changeset.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { tool } from "@opencode-ai/plugin"
import * as fs from 'fs';
import * as path from 'path';
import * as crypto from 'crypto';
import * as fs from 'node:fs';
import * as path from 'node:path';
import * as crypto from 'node:crypto';

const z = tool.schema;

Expand All @@ -13,6 +13,7 @@ const ArgsSchema = z.object({
packages: z.object({}).catchall(BumpSchema).describe('Object mapping package names to bump types (major, minor, patch)'),
summary: z.string().min(10).max(200).describe('Short summary in imperative mood (e.g., "Add retry logic")'),
body: z.string().optional().describe('Optional additional details or migration notes'),
variants: z.string().optional().describe('Optional OpenCode variants setting (e.g., reasoning effort)'),
}).superRefine((value, ctx) => {
const packageCount = Object.keys(value.packages).length;

Expand Down
1 change: 1 addition & 0 deletions src/cli/templates/changeset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
- uses: activadee/open-workflows/actions/changeset@main
with:
mode: commit
variants: "UNDEFINED"
env:
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}${useOAuth ? ENV_OPENCODE_AUTH : ENV_API_KEY}
`;
2 changes: 2 additions & 0 deletions src/cli/templates/doc-sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
fetch-depth: 0

- uses: activadee/open-workflows/actions/doc-sync@main
with:
variants: "UNDEFINED"
env:
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}${useOAuth ? ENV_OPENCODE_AUTH : ENV_API_KEY}
`;
2 changes: 2 additions & 0 deletions src/cli/templates/issue-label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
- uses: actions/checkout@v4

- uses: activadee/open-workflows/actions/issue-label@main
with:
variants: "UNDEFINED"
env:
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}${useOAuth ? ENV_OPENCODE_AUTH : ENV_API_KEY}
`;
2 changes: 2 additions & 0 deletions src/cli/templates/pr-review.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
- uses: actions/checkout@v4

- uses: activadee/open-workflows/actions/pr-review@main
with:
variants: "UNDEFINED"
env:
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}${useOAuth ? ENV_OPENCODE_AUTH : ENV_API_KEY}
`;
8 changes: 5 additions & 3 deletions test/installer.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it, beforeEach, afterEach } from 'bun:test';
import * as fs from 'fs';
import * as path from 'path';
import * as os from 'os';
import * as fs from 'node:fs';
import * as path from 'node:path';
import * as os from 'node:os';
import {
installWorkflows,
checkExistingWorkflows,
Expand Down Expand Up @@ -44,6 +44,7 @@ describe('installer workflow functionality', () => {
'utf-8'
);
expect(content).toContain('activadee/open-workflows/actions/pr-review@main');
expect(content).toContain('variants: "UNDEFINED"');
});

it('includes ANTHROPIC_API_KEY for non-OAuth', () => {
Expand Down Expand Up @@ -205,6 +206,7 @@ describe('installer workflow functionality', () => {
'utf-8'
);
expect(content).toContain('activadee/open-workflows/actions/changeset@main');
expect(content).toContain('variants: "UNDEFINED"');
});

it('includes ANTHROPIC_API_KEY for changeset non-OAuth', () => {
Expand Down
20 changes: 20 additions & 0 deletions test/scripts-variants.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { describe, expect, it } from 'bun:test';
import * as fs from 'node:fs';
import * as path from 'node:path';

describe('tool variants arguments', () => {
it('does not include variants in submit-review args schema', () => {
const content = fs.readFileSync(path.join(import.meta.dir, '../scripts/submit-review.ts'), 'utf-8');
expect(content).not.toContain("variants: z.string().optional()");
});

it('adds variants to apply-labels args schema', () => {
const content = fs.readFileSync(path.join(import.meta.dir, '../scripts/apply-labels.ts'), 'utf-8');
expect(content).toContain("variants: z.string().optional()");
});

it('adds variants to write-changeset args schema', () => {
const content = fs.readFileSync(path.join(import.meta.dir, '../scripts/write-changeset.ts'), 'utf-8');
expect(content).toContain("variants: z.string().optional()");
});
});