GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — add optional prompt Input to Github Action (#4828) · brandonzylstra/opencode@7f86fe3

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • github
    • action.yml
  • packages
    • opencode/src/cli/cmd
      • github.ts
    • web/src/content/docs
      • github.mdx
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎github/action.yml‎

Copy file name to clipboardExpand all lines: github/action.yml
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ inputs:
1313
description: "Share the opencode session (defaults to true for public repos)"
1414
required: false
1515

16+
prompt:
17+
description: "Custom prompt to override the default prompt"
18+
required: false
19+
1620
runs:
1721
using: "composite"
1822
steps:
@@ -27,3 +31,4 @@ runs:
2731
env:
2832
MODEL: ${{ inputs.model }}
2933
SHARE: ${{ inputs.share }}
34+
PROMPT: ${{ inputs.prompt }}
Collapse file

‎packages/opencode/src/cli/cmd/github.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/cli/cmd/github.ts
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,11 @@ export const GithubRunCommand = cmd({
562562
}
563563

564564
async function getUserPrompt() {
565+
const customPrompt = process.env["PROMPT"]
566+
if (customPrompt) {
567+
return { userPrompt: customPrompt, promptFiles: [] }
568+
}
569+
565570
const reviewContext = getReviewCommentContext()
566571
let prompt = (() => {
567572
const body = payload.comment.body.trim()
Collapse file

‎packages/web/src/content/docs/github.mdx‎

Copy file name to clipboardExpand all lines: packages/web/src/content/docs/github.mdx
+20Lines changed: 20 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ Or you can set it up manually.
8282

8383
- `model`: The model to use with opencode. Takes the format of `provider/model`. This is **required**.
8484
- `share`: Whether to share the opencode session. Defaults to **true** for public repositories.
85+
- `prompt`: Optional custom prompt to override the default behavior. Use this to customize how opencode processes requests.
8586
- `token`: Optional GitHub access token for performing operations such as creating comments, committing changes, and opening pull requests. By default, opencode uses the installation access token from the opencode GitHub App, so commits, comments, and pull requests appear as coming from the app.
8687

8788
Alternatively, you can use the GitHub Action runner's [built-in `GITHUB_TOKEN`](https://docs.github.com/en/actions/tutorials/authenticate-with-github_token) without installing the opencode GitHub App. Just make sure to grant the required permissions in your workflow:
@@ -98,6 +99,25 @@ Or you can set it up manually.
9899
99100
---
100101
102+
## Custom prompts
103+
104+
Override the default prompt to customize opencode's behavior for your workflow.
105+
106+
```yaml title=".github/workflows/opencode.yml"
107+
- uses: sst/opencode/github@latest
108+
with:
109+
model: anthropic/claude-sonnet-4-5
110+
prompt: |
111+
Review this pull request:
112+
- Check for code quality issues
113+
- Look for potential bugs
114+
- Suggest improvements
115+
```
116+
117+
This is useful for enforcing specific review criteria, coding standards, or focus areas relevant to your project.
118+
119+
---
120+
101121
## Examples
102122
103123
Here are some examples of how you can use opencode in GitHub.

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.