From 2d2147230c28fc8d91a0d4df8a27fbb88c6b0ed5 Mon Sep 17 00:00:00 2001 From: Nate Date: Tue, 6 Jan 2026 15:54:17 -0800 Subject: [PATCH] fix: prevent string interpolation issues in remaining workflow steps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- .github/workflows/continue-agents.yml | 4 +++- .github/workflows/run-continue-agent.yml | 23 ++++++++++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/continue-agents.yml b/.github/workflows/continue-agents.yml index 4b6b20d52..8c96ede98 100644 --- a/.github/workflows/continue-agents.yml +++ b/.github/workflows/continue-agents.yml @@ -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(), diff --git a/.github/workflows/run-continue-agent.yml b/.github/workflows/run-continue-agent.yml index 70b92dff5..476c033a6 100644 --- a/.github/workflows/run-continue-agent.yml +++ b/.github/workflows/run-continue-agent.yml @@ -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"