Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 29 additions & 13 deletions .github/workflows/continue-agents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ jobs:

- name: Discover agents
id: discover
env:
AGENTS_PATH: ${{ inputs.agents-path }}
run: |
AGENTS_DIR="${{ inputs.agents-path }}"
AGENTS_DIR="$AGENTS_PATH"
if [ -d "$AGENTS_DIR" ]; then
# Use -sc for compact single-line JSON (required for GitHub Actions output)
FILES=$(find "$AGENTS_DIR" -name "*.md" -type f 2>/dev/null | jq -R . | jq -sc .)
Expand Down Expand Up @@ -67,20 +69,24 @@ jobs:

- name: Extract agent name
id: agent-name
env:
AGENT_FILE: ${{ matrix.agent }}
run: |
AGENT_FILE="${{ matrix.agent }}"
AGENT_NAME=$(basename "$AGENT_FILE" .md)
echo "name=$AGENT_NAME" >> $GITHUB_OUTPUT

- name: Create Check Run
id: check
uses: actions/github-script@v7
env:
AGENT_NAME: ${{ steps.agent-name.outputs.name }}
with:
script: |
const agentName = process.env.AGENT_NAME || 'unknown';
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: ${agentName}`,
head_sha: context.sha,
status: 'in_progress',
started_at: new Date().toISOString(),
Expand All @@ -91,9 +97,8 @@ jobs:
id: run
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
AGENT_FILE: ${{ matrix.agent }}
run: |
AGENT_FILE="${{ matrix.agent }}"

# Run agent in non-interactive mode (-p flag)
if OUTPUT=$(cn -p --agent "$AGENT_FILE" 2>&1); then
echo "success=true" >> $GITHUB_OUTPUT
Expand All @@ -117,22 +122,27 @@ jobs:

- name: Write job summary
if: always()
env:
AGENT_NAME: ${{ steps.agent-name.outputs.name }}
AGENT_SUCCESS: ${{ steps.run.outputs.success }}
AGENT_OUTPUT: ${{ steps.run.outputs.output }}
AGENT_ERROR: ${{ steps.run.outputs.error }}
run: |
echo "## 🤖 Agent: ${{ steps.agent-name.outputs.name }}" >> $GITHUB_STEP_SUMMARY
echo "## 🤖 Agent: $AGENT_NAME" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "${{ steps.run.outputs.success }}" == "true" ]; then
if [ "$AGENT_SUCCESS" == "true" ]; then
echo "✅ **Status:** Completed successfully" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Output" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "${{ steps.run.outputs.output }}" >> $GITHUB_STEP_SUMMARY
echo "$AGENT_OUTPUT" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
else
echo "❌ **Status:** Failed" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Error" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "${{ steps.run.outputs.error }}" >> $GITHUB_STEP_SUMMARY
echo "$AGENT_ERROR" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
fi

Expand All @@ -143,16 +153,22 @@ jobs:
- name: Update Check Run
if: always()
uses: actions/github-script@v7
env:
AGENT_SUCCESS: ${{ steps.run.outputs.success }}
AGENT_OUTPUT: ${{ steps.run.outputs.output }}
AGENT_ERROR: ${{ steps.run.outputs.error }}
CHECK_RUN_ID: ${{ steps.check.outputs.id }}
with:
script: |
const success = '${{ steps.run.outputs.success }}' === 'true';
const output = `${{ steps.run.outputs.output }}`;
const error = `${{ steps.run.outputs.error }}`;
const success = process.env.AGENT_SUCCESS === 'true';
const output = process.env.AGENT_OUTPUT || '';
const error = process.env.AGENT_ERROR || '';
const checkRunId = parseInt(process.env.CHECK_RUN_ID, 10);

await github.rest.checks.update({
owner: context.repo.owner,
repo: context.repo.repo,
check_run_id: ${{ steps.check.outputs.id }},
check_run_id: checkRunId,
status: 'completed',
conclusion: success ? 'success' : 'failure',
completed_at: new Date().toISOString(),
Expand Down