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"