fix claude prompt

This commit is contained in:
Yen Nguyen 2026-03-30 12:28:56 +02:00
parent 63d41399b8
commit 59b5c3245c
1 changed files with 12 additions and 12 deletions

View File

@ -20,10 +20,10 @@ jobs:
LABELS='${{ toJson(github.event.issue.labels) }}'
echo "Raw labels: $LABELS"
IS_BUG=$(echo "$LABELS" | jq '[.[].name | ascii_downcase] | any(. == "bug")' 2>/dev/null || echo "false")
IS_IDEATION=$(echo "$LABELS" | jq '[.[].name | ascii_downcase] | any(. == "help wanted")' 2>/dev/null || echo "false")
IS_ENHANCEMENT=$(echo "$LABELS" | jq '[.[].name | ascii_downcase] | any(. == "enhancement")' 2>/dev/null || echo "false")
echo "is_bug=$IS_BUG" >> $GITHUB_OUTPUT
echo "is_ideation=$IS_IDEATION" >> $GITHUB_OUTPUT
echo "is_bug=$IS_BUG | is_ideation=$IS_IDEATION"
echo "is_enhancement=$IS_ENHANCEMENT" >> $GITHUB_OUTPUT
echo "is_bug=$IS_BUG | is_enhancement=$IS_ENHANCEMENT"
- name: Checkout repository
uses: actions/checkout@v4
@ -189,11 +189,11 @@ jobs:
-d "$PAYLOAD"
# ─────────────────────────────────────────────
# IDEATION FLOW: research + comment only
# ENHANCEMENT FLOW: research + comment only
# ─────────────────────────────────────────────
- name: "[Ideation] Run Claude Code to research"
if: steps.classify.outputs.is_ideation == 'true'
id: claude-ideation
- name: "[Enhancement] Run Claude Code to research"
if: steps.classify.outputs.is_enhancement == 'true'
id: claude-enhancement
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
@ -221,19 +221,19 @@ jobs:
--allowedTools "Read,Glob,Grep,WebSearch,WebFetch" \
--max-turns 15 \
--output-format text \
-p "$PROMPT" > /tmp/claude_ideation_output.txt 2>&1 || true
-p "$PROMPT" > /tmp/claude_enhancement_output.txt 2>&1 || true
echo "--- Claude output ---"
cat /tmp/claude_ideation_output.txt
cat /tmp/claude_enhancement_output.txt
- name: "[Ideation] Comment research findings on issue"
if: steps.classify.outputs.is_ideation == 'true'
- name: "[Enhancement] Comment research findings on issue"
if: steps.classify.outputs.is_enhancement == 'true'
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
REPO: ${{ github.repository }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
BASE_URL: ${{ github.server_url }}
run: |
RESEARCH=$(cat /tmp/claude_ideation_output.txt 2>/dev/null || echo "Research output unavailable.")
RESEARCH=$(cat /tmp/claude_enhancement_output.txt 2>/dev/null || echo "Research output unavailable.")
COMMENT=$(printf "## Research Findings\n\nI've explored the codebase and researched this idea. Here's what I found:\n\n%s\n\n---\n*This research was performed automatically by Claude Code. Feel free to discuss further in the comments.*" \
"$RESEARCH")
PAYLOAD=$(jq -n --arg body "$COMMENT" '{body: $body}')