-
Notifications
You must be signed in to change notification settings - Fork 3.5k
github: support schedule events #5810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I also tried to keep this pretty compact — most of the scaffolding was there, but b/c |
|
call Stack: Failure Modes
Key Differences
|
|
User elithrar does not have write permissions |
8f05095 to
d98ec97
Compare
|
OK, I think I’m happy with this after staring at it again last night. |
|
/review |
|
lgtm |
|
oh @elithrar I should really clean this up but rn At one point we meant to move it to be fully contained in the action and that's why github/index.ts exists but we never finished the migration and now it's just sitting there, so youll probably want to make changes to cmd/github.ts instead Unless this changed recently ig, but last I checked that was the case still... |
|
Yeah appears to still use github cmd: Line 66 in ad6a5e6
|
|
ah duh — all the other PRs I've made have been against the CLI imp. Fixing. |
d2c8e5f to
5a779fd
Compare
|
fixed + upgraded diagram to show a couple of tweaks |
2eb281e to
981bcd2
Compare
|
/review |
- add schedule to allowed event types
- skip keyword check, permissions, reactions for schedule events
- require PROMPT input for schedule events
- branch naming: opencode/scheduled-{6-char-hex}-{timestamp}
- omit co-authored-by on commits (schedule operates as the repo)
- output to console instead of creating comments
- add docs with Supported Events table and schedule example
f2b5bf9 to
aecb8b8
Compare
|
Updated this and re-reviewed.
If we add more events I want to re-think how we can make the active user
event vs repo driven event control flow easier to follow.
…On Sat, Dec 20, 2025 at 16:38 github-actions[bot] ***@***.***> wrote:
***@***.***[bot]* commented on this pull request.
------------------------------
In packages/opencode/src/cli/cmd/github.ts
<#5810 (comment)>:
> reaction_id: eyesReaction.id,
})
}
async function createComment(body: string) {
+ // Only called for non-schedule events, so issueId is defined
console.log("Creating comment...")
return await octoRest.rest.issues.createComment({
*Potential bug:* The comment says "Only called for non-schedule events",
but the catch block in the main try/catch (around line 536-542) calls
createComment() unconditionally on error, which would fail for schedule
events since issueId is undefined.
You may want to wrap the catch block calls to createComment() and
removeReaction() with if (!isScheduleEvent) to prevent runtime errors
during scheduled runs.
—
Reply to this email directly, view it on GitHub
<#5810 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAEQ4GGMIXKM4E5UWFXL5T4CW6XDAVCNFSM6AAAAACPSMSIDCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTMMBRGMZDMNZYGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
/review |
|
Code review complete. Found one potential bug (commented inline). Otherwise the code follows the style guide - uses early returns where appropriate, keeps functions together, and doesn't introduce unnecessary else statements or excessive nesting. The changes look good overall. |
|
Reviewed and addressed the following for schedule event handling:
|
note: draft for now as I want to make sure we're happy with this / think through it over the weekend.
Adds support for
scheduleevents in the GitHub Action, allowing users to run OpenCode on a cron schedule.scheduleto allowed event types/opencodekeyword check for schedule events (no comment to parse)promptinput is required for schedule eventsopencode/scheduled-{6-random-hex-chars}-{timestamp}Users can now create scheduled workflows that invoke OpenCode with a prompt to perform automated tasks like code reviews, reports, or maintenance. OpenCode can still open PRs/issues and call tools (webhooks, etc.) as needed.