MCPcopy Index your code
hub / github.com/anomalyco/opencode / addWorkflowFiles

Function addWorkflowFiles

packages/opencode/src/cli/cmd/github.handler.ts:329–371  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

327 }
328
329 async function addWorkflowFiles() {
330 const envStr =
331 provider === "amazon-bedrock"
332 ? ""
333 : `\n env:${providers[provider].env.map((e) => `\n ${e}: \${{ secrets.${e} }}`).join("")}`
334
335 await Filesystem.write(
336 path.join(app.root, WORKFLOW_FILE),
337 `name: opencode
338
339on:
340 issue_comment:
341 types: [created]
342 pull_request_review_comment:
343 types: [created]
344
345jobs:
346 opencode:
347 if: |
348 contains(github.event.comment.body, ' /oc') ||
349 startsWith(github.event.comment.body, '/oc') ||
350 contains(github.event.comment.body, ' /opencode') ||
351 startsWith(github.event.comment.body, '/opencode')
352 runs-on: ubuntu-latest
353 permissions:
354 id-token: write
355 contents: read
356 pull-requests: read
357 issues: read
358 steps:
359 - name: Checkout repository
360 uses: actions/checkout@v6
361 with:
362 persist-credentials: false
363
364 - name: Run opencode
365 uses: anomalyco/opencode/github@latest${envStr}
366 with:
367 model: ${provider}/${model}`,
368 )
369
370 prompts.log.success(`Added workflow file: "${WORKFLOW_FILE}"`)
371 }
372 }
373 })
374})

Callers 1

github.handler.tsFile · 0.85

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected