name: "opencodeGitHubAction"description: "RunopencodeinGitHubActionsworkflows"branding:icon: "code"color: "orange"inputs:model:description: "Modeltouse"required: trueagent:description: "Agenttouse.Mustbeaprimaryagent.Fallsbacktodefault_agentfromconfigor'build'ifnotfound."required: falseshare:description: "Sharetheopencodesession(defaultstotrueforpublicrepos)"required: falseprompt:description: "Customprompttooverridethedefaultprompt"required: falseuse_github_token:description: "UseGITHUB_TOKENdirectlyinsteadofOpenCodeApptokenexchange.Whentrue,skipsOIDCandusestheGITHUB_TOKENenvvar."required: falsedefault: "false"mentions:description: "Comma-separatedlistoftriggerphrases(case-insensitive).Defaultsto'/opencode,/oc'"required: falsevariant:description: "Modelvariantforprovider-specificreasoningeffort(e.g.,high,max,minimal)"required: falseoidc_base_url:description: "BaseURLforOIDCtokenexchangeAPI.OnlyrequiredwhenrunningacustomGitHubAppinstall.Defaultstohttps://api.opencode.ai"required: falseruns:using: "composite"steps:- name: Get opencode versionid: versionshell: bashrun: |VERSION=$(curl -sf https://api.github.com/repos/anomalyco/opencode/releases/latest | grep -o '"tag_name": *"[^"]*"' | cut -d'"' -f4)echo "version=${VERSION:-latest}" >> $GITHUB_OUTPUT- name: Cache opencodeid: cacheuses: actions/cache@v4with:path: ~/.opencode/binkey: opencode-${{ runner.os }}-${{ runner.arch }}-${{ steps.version.outputs.version }}- name: Install opencodeif: steps.cache.outputs.cache-hit != 'true'shell: bashrun: curl -fsSL https://opencode.ai/install | bash- name: Add opencode to PATHshell: bashrun: echo "$HOME/.opencode/bin" >> $GITHUB_PATH- name: Run opencodeshell: bashid: run_opencoderun: opencode github runenv:MODEL: ${{ inputs.model }}AGENT: ${{ inputs.agent }}SHARE: ${{ inputs.share }}PROMPT: ${{ inputs.prompt }}USE_GITHUB_TOKEN: ${{ inputs.use_github_token }}MENTIONS: ${{ inputs.mentions }}VARIANT: ${{ inputs.variant }}OIDC_BASE_URL: ${{ inputs.oidc_base_url }}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。