From 10375263ef03740d530cbc626ee775914fbffacc Mon Sep 17 00:00:00 2001
From: Matt Silverlock <matt@eatsleeprepeat.net>
Date: Sun, 21 Dec 2025 09:46:54 -0500
Subject: github: support schedule events (#5810)

---
 packages/web/src/content/docs/github.mdx | 50 ++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

(limited to 'packages/web/src/content/docs/github.mdx')

diff --git a/packages/web/src/content/docs/github.mdx b/packages/web/src/content/docs/github.mdx
index 1d6078840..bd792f92f 100644
--- a/packages/web/src/content/docs/github.mdx
+++ b/packages/web/src/content/docs/github.mdx
@@ -100,6 +100,56 @@ Or you can set it up manually.
 
 ---
 
+## Supported Events
+
+OpenCode can be triggered by the following GitHub events:
+
+| Event Type                    | Triggered By                           | Details                                                                                                                                                             |
+| ----------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `issue_comment`               | Comment on an issue or PR              | Mention `/opencode` or `/oc` in your comment. OpenCode reads the issue/PR context and can create branches, open PRs, or reply with explanations.                    |
+| `pull_request_review_comment` | Comment on specific code lines in a PR | Mention `/opencode` or `/oc` while reviewing code. OpenCode receives file path, line numbers, and diff context for precise responses.                               |
+| `schedule`                    | Cron-based schedule                    | Run OpenCode on a schedule using the `prompt` input. Useful for automated code reviews, reports, or maintenance tasks. OpenCode can create issues or PRs as needed. |
+
+### Schedule Example
+
+Run OpenCode on a schedule to perform automated tasks:
+
+```yaml title=".github/workflows/opencode-scheduled.yml"
+name: Scheduled OpenCode Task
+
+on:
+  schedule:
+    - cron: "0 9 * * 1" # Every Monday at 9am UTC
+
+jobs:
+  opencode:
+    runs-on: ubuntu-latest
+    permissions:
+      id-token: write
+      contents: write
+      pull-requests: write
+      issues: write
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v4
+
+      - name: Run OpenCode
+        uses: sst/opencode/github@latest
+        env:
+          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
+        with:
+          model: anthropic/claude-sonnet-4-20250514
+          prompt: |
+            Review the codebase for any TODO comments and create a summary.
+            If you find issues worth addressing, open an issue to track them.
+```
+
+For scheduled events, the `prompt` input is **required** since there's no comment to extract instructions from.
+
+> **Note:** Scheduled workflows run without a user context to permission-check, so the workflow must grant `contents: write` and `pull-requests: write` if you expect OpenCode to create branches or PRs during a scheduled run.
+
+---
+
 ## Custom prompts
 
 Override the default prompt to customize OpenCode's behavior for your workflow.
-- 
cgit v1.2.3

