GeezerVison is showing github.com — wip: github actions · FellowTraveler/opencode@670f470
File treeExpand file treeCollapse file tree Open diff view settings web/src/content/docs/docs
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: github/README.md +11-5Lines changed: 11 additions & 5 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -6,21 +6,27 @@ Mention `/opencode` in your comment, and opencode will execute tasks within your | 6 | 6 |
| 7 | 7 | ## Features | 8 | 8 |
| 9 | | -#### Triage and explain issues | | 9 | +#### Explain an issues | 10 | 10 |
| 11 | | -```bash | | 11 | +Leave the following comment on a GitHub issue. `opencode` will read the entire thread, including all comments, and reply with a clear explanation. | | 12 | + | | 13 | +``` | 12 | 14 | /opencode explain this issue | 13 | 15 | ``` | 14 | 16 |
| 15 | | -#### Fix or implement issues - opencode will create a PR with the changes. | | 17 | +#### Fix an issues | 16 | 18 |
| 17 | | -```bash | | 19 | +Leave the following comment on a GitHub issue. opencode will create a new branch, implement the changes, and open a PR with the changes. | | 20 | + | | 21 | +``` | 18 | 22 | /opencode fix this | 19 | 23 | ``` | 20 | 24 |
| 21 | 25 | #### Review PRs and make changes | 22 | 26 |
| 23 | | -```bash | | 27 | +Leave the following comment on a GitHub PR. opencode will implement the requested change and commit it to the same PR. | | 28 | + | | 29 | +``` | 24 | 30 | Delete the attachment from S3 when the note is removed /oc | 25 | 31 | ``` | 26 | 32 |
| |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/cli/cmd/github.ts +15-11Lines changed: 15 additions & 11 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -156,21 +156,23 @@ export const GithubInstallCommand = cmd({ | 156 | 156 | step2 = | 157 | 157 | "Configure OIDC in AWS - https://docs.github.com/en/actions/how-tos/security-for-github-actions/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services" | 158 | 158 | } else { | 159 | | - const url = `https://github.com/organizations/${app.owner}/settings/secrets/actions` | 160 | | - const env = providers[provider].env | 161 | | - const envStr = | 162 | | - env.length === 1 | 163 | | - ? `\`${env[0]}\` secret` | 164 | | - : `\`${[env.slice(0, -1).join("\`, \`"), ...env.slice(-1)].join("\` and \`")}\` secrets` | 165 | | - step2 = `Add ${envStr} for ${providers[provider].name} - ${url}` | | 159 | + step2 = [ | | 160 | + ` 2. Add the following secrets in org or repo (${app.owner}/${app.repo}) settings`, | | 161 | + "", | | 162 | + ...providers[provider].env.map((e) => ` - ${e}`), | | 163 | + ].join("\n") | 166 | 164 | } | 167 | 165 |
| 168 | 166 | prompts.outro( | 169 | 167 | [ | 170 | 168 | "Next steps:", | 171 | | - ` 1. Commit "${WORKFLOW_FILE}" file and push`, | 172 | | - ` 2. ${step2}`, | 173 | | - " 3. Learn how to use the GitHub agent - https://docs.opencode.ai/docs/github/getting-started", | | 169 | + "", | | 170 | + ` 1. Commit the \`${WORKFLOW_FILE}\` file and push`, | | 171 | + step2, | | 172 | + "", | | 173 | + " 3. Go to a GitHub issue and comment `/oc summarize` to see the agent in action", | | 174 | + "", | | 175 | + " Learn more about the GitHub agent - https://opencode.ai/docs/github/#usage-examples", | 174 | 176 | ].join("\n"), | 175 | 177 | ) | 176 | 178 | } | @@ -320,6 +322,7 @@ jobs: | 320 | 322 | contains(github.event.comment.body, '/opencode') | 321 | 323 | runs-on: ubuntu-latest | 322 | 324 | permissions: | | 325 | + contents: read | 323 | 326 | id-token: write | 324 | 327 | steps: | 325 | 328 | - name: Checkout repository | @@ -457,8 +460,9 @@ export const GithubRunCommand = cmd({ | 457 | 460 | `${response}\n\nCloses #${issueId}${footer({ image: true })}`, | 458 | 461 | ) | 459 | 462 | await updateComment(`Created PR #${pr}${footer({ image: true })}`) | | 463 | + } else { | | 464 | + await updateComment(`${response}${footer({ image: true })}`) | 460 | 465 | } | 461 | | - await updateComment(`${response}${footer({ image: true })}`) | 462 | 466 | } | 463 | 467 | } catch (e: any) { | 464 | 468 | exitCode = 1 | |
Collapse file Copy file name to clipboardExpand all lines: packages/web/src/content/docs/docs/github.mdx +10-4Lines changed: 10 additions & 4 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -77,18 +77,24 @@ This will walk you through installing the GitHub app, creating the workflow, and | 77 | 77 |
| 78 | 78 | - Explain an issue | 79 | 79 |
| 80 | | - ```bash | | 80 | + Leave the following comment on a GitHub issue. `opencode` will read the entire thread, including all comments, and reply with a clear explanation. | | 81 | + | | 82 | + ``` | 81 | 83 | /opencode explain this issue | 82 | 84 | ``` | 83 | 85 |
| 84 | | -- Fix an issue - opencode will create a PR with the changes. | | 86 | +- Fix an issue | | 87 | + | | 88 | + Leave the following comment on a GitHub issue. opencode will create a new branch, implement the changes, and open a PR with the changes. | 85 | 89 |
| 86 | | - ```bash | | 90 | + ``` | 87 | 91 | /opencode fix this | 88 | 92 | ``` | 89 | 93 |
| 90 | 94 | - Review PRs and make changes | 91 | 95 |
| 92 | | - ```bash | | 96 | + Leave the following comment on a GitHub PR. opencode will implement the requested change and commit it to the same PR. | | 97 | + | | 98 | + ``` | 93 | 99 | Delete the attachment from S3 when the note is removed /oc | 94 | 100 | ``` |
|