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>
This commit is contained in:
Nate 2026-01-06 15:54:17 -08:00
parent 8969f42261
commit 2d2147230c
2 changed files with 19 additions and 8 deletions

View file

@ -75,12 +75,14 @@ jobs:
- name: Create Check Run
id: check
uses: actions/github-script@v8
env:
AGENT_NAME: ${{ steps.agent-name.outputs.name }}
with:
script: |
const { data: check } = await github.rest.checks.create({
owner: context.repo.owner,
repo: context.repo.repo,
name: `Continue: ${{ steps.agent-name.outputs.name }}`,
name: `Continue: ${process.env.AGENT_NAME}`,
head_sha: context.sha,
status: 'in_progress',
started_at: new Date().toISOString(),

View file

@ -28,15 +28,24 @@ jobs:
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 ${{ secrets.CONTINUE_API_KEY }}" \
-d '{
"prompt": "${{ inputs.prompt }}",
"agent": "${{ inputs.agent }}",
"branchName": "${{ inputs.branch_name }}",
"repoUrl": "https://github.com/${{ github.repository }}"
}')
-H "Authorization: Bearer $CONTINUE_API_KEY" \
-d "$json_body")
id=$(echo $response | jq -r '.id')
echo "https://hub.continue.dev/hub?type=agents/$id"