-
Notifications
You must be signed in to change notification settings - Fork 1
Added support for expo #212
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: opencode | ||
|
|
||
| on: | ||
| issue_comment: | ||
| types: [created] | ||
| pull_request_review_comment: | ||
| types: [created] | ||
|
|
||
| jobs: | ||
| opencode: | ||
| if: | | ||
| contains(github.event.comment.body, ' /oc') || | ||
| startsWith(github.event.comment.body, '/oc') || | ||
| contains(github.event.comment.body, ' /opencode') || | ||
| startsWith(github.event.comment.body, '/opencode') | ||
| runs-on: ubuntu-latest | ||
|
Comment on lines
+11
to
+16
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restrict comment-triggered runs to trusted actors. As written, any commenter can trigger a run that has access to secrets. Add author-association gating (and ideally PR-only checks) to prevent untrusted execution. 🔒 Suggested guardrail- if: |
- contains(github.event.comment.body, ' /oc') ||
- startsWith(github.event.comment.body, '/oc') ||
- contains(github.event.comment.body, ' /opencode') ||
- startsWith(github.event.comment.body, '/opencode')
+ if: |
+ (contains(github.event.comment.body, ' /oc') ||
+ startsWith(github.event.comment.body, '/oc') ||
+ contains(github.event.comment.body, ' /opencode') ||
+ startsWith(github.event.comment.body, '/opencode')) &&
+ (github.event.comment.author_association == 'OWNER' ||
+ github.event.comment.author_association == 'MEMBER' ||
+ github.event.comment.author_association == 'COLLABORATOR') &&
+ (
+ github.event_name == 'pull_request_review_comment' ||
+ (github.event_name == 'issue_comment' && github.event.issue.pull_request != null)
+ )🤖 Prompt for AI Agents |
||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
| pull-requests: read | ||
| issues: read | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Run opencode | ||
| uses: anomalyco/opencode/github@latest | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Pin the Prompt for AI agents |
||
| env: | ||
| OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} | ||
| with: | ||
| model: opencode/grok-code | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,15 @@ export const frameworkEnum = v.union( | |
| v.literal("ANGULAR"), | ||
| v.literal("REACT"), | ||
| v.literal("VUE"), | ||
| v.literal("SVELTE") | ||
| v.literal("SVELTE"), | ||
| v.literal("EXPO") | ||
| ); | ||
|
|
||
| export const expoPreviewModeEnum = v.union( | ||
| v.literal("web"), | ||
| v.literal("expo-go"), | ||
| v.literal("android-emulator"), | ||
| v.literal("eas-build") | ||
| ); | ||
|
|
||
| export const messageRoleEnum = v.union( | ||
|
|
@@ -115,6 +123,11 @@ export default defineSchema({ | |
| files: v.any(), | ||
| metadata: v.optional(v.any()), | ||
| framework: frameworkEnum, | ||
| expoPreviewMode: v.optional(expoPreviewModeEnum), | ||
| expoQrCodeUrl: v.optional(v.string()), | ||
| expoVncUrl: v.optional(v.string()), | ||
| expoEasBuildUrl: v.optional(v.string()), | ||
| expoApkUrl: v.optional(v.string()), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Schema fields added without updating corresponding mutationMedium Severity The |
||
| createdAt: v.optional(v.number()), | ||
| updatedAt: v.optional(v.number()), | ||
| }) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1: Guard the workflow against untrusted commenters. As written, any GitHub user can trigger this job via
/ocand run a secret-backed action, which risks abuse of the OPENCODE_API_KEY and workflow resources. Add an author association check (owner/member/collaborator) or similar gating before running.Prompt for AI agents