Skip to content

perf: reduce CLI authentication and error import graphs #352

perf: reduce CLI authentication and error import graphs

perf: reduce CLI authentication and error import graphs #352

Workflow file for this run

name: Roboreview
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.issue.number || github.ref }}
cancel-in-progress: false
jobs:
roboreview:
# Triggered only by a 🤖 emoji in the comment body, from a non-bot author.
if: github.event.sender.type != 'Bot' && contains(github.event.comment.body, '🤖')
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
id-token: write
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Build prompt with triggering comment
id: prompt
run: |
{
DELIMITER=$(openssl rand -hex 16)
echo "value<<$DELIMITER"
echo "You were invoked by @${{ github.event.comment.user.login }} on ${{ github.event.comment.html_url }}"
echo ""
echo "Their comment:"
echo '```'
echo "$COMMENT_BODY"
echo '```'
echo ""
echo "This is your task. Read it carefully and act on it."
echo "$DELIMITER"
} >> "$GITHUB_OUTPUT"
env:
COMMENT_BODY: ${{ github.event.comment.body }}
- name: Run Roboreview
uses: Cloudflare-Studio/ask-bonk/github@main
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_AI_GATEWAY_ACCOUNT_ID }}
CLOUDFLARE_GATEWAY_ID: ${{ secrets.CF_AI_GATEWAY_NAME }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_AI_GATEWAY_TOKEN }}
# Paths outside the checkout are denied, not prompted: nobody can answer a prompt in CI.
OPENCODE_CONFIG_CONTENT: '{"permission":{"external_directory":{"*":"deny","/home/runner/work/**":"allow"},"question":"deny","doom_loop":"deny"}}'
with:
oidc_base_url: https://ask-bonk.cloudflare-exponent.workers.dev/auth
model: "cloudflare-ai-gateway/openai/gpt-5.6-terra"
mentions: "🤖"
variant: "high"
permissions: write
agent: roboreview
# Temporary: the gateway-token fix is only in OpenCode's dev channel.
# Swap back to a stable pin once it lands in a release.
opencode_dev: true
opencode_version: "latest"
prompt: ${{ steps.prompt.outputs.value }}