콘텐츠로 이동

GitHub

Use OpenCtrlC in GitHub issues and pull requests.

이 콘텐츠는 아직 번역되지 않았습니다.

OpenCtrlC runs inside your GitHub Actions runner. Mention /openctrlc or /oc in an issue or pull request comment, and it can explain the context, edit the checkout, and open a pull request.

What you need

  • A GitHub repository with Actions enabled.
  • Write permissions for contents, issues, and pull-requests.
  • An API key for the provider and model you want to use.

OpenCtrlC does not require a GitHub App or an OpenCtrlC-hosted account. The workflow uses GitHub’s built-in GITHUB_TOKEN and your provider key.

Setup

Create .github/workflows/openctrlc.yml in the repository:

.github/workflows/openctrlc.yml
name: OpenCtrlC
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
jobs:
openctrlc:
if: |
contains(github.event.comment.body, '/oc') ||
contains(github.event.comment.body, '/openctrlc')
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Run OpenCtrlC
uses: ponponon/openctrlc/github@latest
env:
GITHUB_TOKEN: ${{ github.token }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
with:
model: anthropic/claude-sonnet-4-20250514
use_github_token: true

Replace the model and provider secret with the provider you use. Store provider API keys under Settings → Secrets and variables → Actions. Do not commit API keys to the repository.

The shortcut command can generate a starter workflow from a local checkout:

Terminal window
openctrlc github install

This command only writes the workflow file and prints the required secret names. It does not install a GitHub App.

Configuration

  • model is required and uses the provider/model format.
  • agent selects the primary agent; it falls back to the configured default agent.
  • prompt overrides the comment text for scheduled, issue, and pull-request workflows.
  • use_github_token defaults to true and uses the runner’s token directly.
  • share defaults to false. Sharing requires an external service configured through SHARE_URL; OpenCtrlC does not host session sharing.
  • oidc_base_url is only for teams that operate a compatible private token-exchange service and explicitly set use_github_token: false.

Supported events

  • issue_comment: react to /openctrlc or /oc in an issue or pull request.
  • pull_request_review_comment: review the commented code and its diff context.
  • issues, pull_request, schedule, and workflow_dispatch: run with an explicit prompt.

For pull requests from forks, GitHub may restrict write access. Review the repository’s fork and Actions permission settings before enabling automatic changes.

Security notes

Keep provider keys in GitHub Actions secrets. Use the smallest permissions your workflow needs, review third-party workflow changes, and avoid enabling write access for untrusted pull-request code.

See the GitHub Action source and GitHub discussions for implementation details and support.