continue-custom/.github/workflows/run-continue-agent.yml
Nate 2d2147230c fix: prevent string interpolation issues in remaining workflow steps
- continue-agents.yml: Use env var for agent name in Create Check Run step
  (prevents JS template literal breakage with backticks in filenames)

- run-continue-agent.yml: Use jq to construct JSON body instead of
  string interpolation (prevents JSON syntax errors when prompt contains
  quotes, newlines, backslashes, or other special characters)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 15:54:17 -08:00

51 lines
1.6 KiB
YAML

name: Run Continue Agent
on:
workflow_call:
inputs:
prompt:
description: "Additional prompting to send to the Continue agent"
required: false
type: string
default: ""
agent:
description: "The agent to use (e.g., continuedev/github-pr-agent)"
required: true
type: string
default: "continuedev/github-pr-agent"
branch_name:
description: "The base branch name to work from"
required: false
type: string
default: "main"
secrets:
CONTINUE_API_KEY:
required: true
jobs:
run-agent:
runs-on: ubuntu-latest
steps:
- name: Call agents endpoint
env:
PROMPT: ${{ inputs.prompt }}
AGENT: ${{ inputs.agent }}
BRANCH_NAME: ${{ inputs.branch_name }}
REPO_URL: https://github.com/${{ github.repository }}
CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }}
run: |
# Use jq to properly construct JSON with safe escaping
json_body=$(jq -n \
--arg prompt "$PROMPT" \
--arg agent "$AGENT" \
--arg branchName "$BRANCH_NAME" \
--arg repoUrl "$REPO_URL" \
'{prompt: $prompt, agent: $agent, branchName: $branchName, repoUrl: $repoUrl}')
response=$(curl -f -X POST https://api.continue.dev/agents \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $CONTINUE_API_KEY" \
-d "$json_body")
id=$(echo $response | jq -r '.id')
echo "https://hub.continue.dev/hub?type=agents/$id"