-
Notifications
You must be signed in to change notification settings - Fork 0
feat(setup): update OMO and setup config handling #266
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
Changes from all commits
1ad9e83
fc294b4
4c7ccf5
dd55826
aeb0679
1b02545
22a2bf6
f84ad43
1f9f2c4
d6dbbb1
a0fda79
619abdf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -65,6 +65,7 @@ const VALID_OMO_PROVIDERS = [ | |||||||||||||||||||||||
| 'openai', | ||||||||||||||||||||||||
| 'opencode-zen', | ||||||||||||||||||||||||
| 'zai-coding-plan', | ||||||||||||||||||||||||
| 'kimi-for-coding', | ||||||||||||||||||||||||
| ] as const | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| type OmoProviderInput = (typeof VALID_OMO_PROVIDERS)[number] | ||||||||||||||||||||||||
|
|
@@ -81,6 +82,7 @@ function parseOmoProviders(input: string): OmoProviders { | |||||||||||||||||||||||
| let openai: 'no' | 'yes' = 'no' | ||||||||||||||||||||||||
| let opencodeZen: 'no' | 'yes' = 'no' | ||||||||||||||||||||||||
| let zaiCodingPlan: 'no' | 'yes' = 'no' | ||||||||||||||||||||||||
| let kimiForCoding: 'no' | 'yes' = 'no' | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| for (const provider of providers) { | ||||||||||||||||||||||||
| if (!VALID_OMO_PROVIDERS.includes(provider as OmoProviderInput)) { | ||||||||||||||||||||||||
|
|
@@ -109,10 +111,13 @@ function parseOmoProviders(input: string): OmoProviders { | |||||||||||||||||||||||
| case 'zai-coding-plan': | ||||||||||||||||||||||||
| zaiCodingPlan = 'yes' | ||||||||||||||||||||||||
| break | ||||||||||||||||||||||||
| case 'kimi-for-coding': | ||||||||||||||||||||||||
| kimiForCoding = 'yes' | ||||||||||||||||||||||||
| break | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| return {claude, copilot, gemini, openai, opencodeZen, zaiCodingPlan} | ||||||||||||||||||||||||
| return {claude, copilot, gemini, openai, opencodeZen, zaiCodingPlan, kimiForCoding} | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||
|
|
@@ -179,6 +184,23 @@ export function parseActionInputs(): Result<ActionInputs, Error> { | |||||||||||||||||||||||
| const omoProvidersRaw = core.getInput('omo-providers').trim() | ||||||||||||||||||||||||
| const omoProviders = parseOmoProviders(omoProvidersRaw.length > 0 ? omoProvidersRaw : DEFAULT_OMO_PROVIDERS) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| const opencodeConfigRaw = core.getInput('opencode-config').trim() | ||||||||||||||||||||||||
| const opencodeConfig = opencodeConfigRaw.length > 0 ? opencodeConfigRaw : null | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| // Validate opencode-config is valid JSON if provided | ||||||||||||||||||||||||
| if (opencodeConfig != null) { | ||||||||||||||||||||||||
| validateJsonString(opencodeConfig, 'opencode-config') | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
| validateJsonString(opencodeConfig, 'opencode-config') | |
| validateJsonString(opencodeConfig, 'opencode-config') | |
| const parsedOpencodeConfig = JSON.parse(opencodeConfig) | |
| const isObject = typeof parsedOpencodeConfig === 'object' | |
| const isNull = parsedOpencodeConfig === null | |
| const isArray = Array.isArray(parsedOpencodeConfig) | |
| if (!isObject || isNull || isArray) { | |
| throw new Error("Input 'opencode-config' must be a JSON object") | |
| } |
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.
The README inputs table was updated to document
omo-config, but this PR also introduces theopencode-configinput inaction.yamland it is not documented anywhere in the README. Please add a corresponding row so users can discover and correctly format the new input.