@@ -57,39 +57,24 @@ jobs:
5757
5858 TITLE=$(echo "$ISSUE_JSON" | jq -r '.title')
5959 URL=$(echo "$ISSUE_JSON" | jq -r '.url')
60- BODY=$(echo "$ISSUE_JSON" | jq -r '.body')
61-
6260 echo "title=$TITLE" >> "$GITHUB_OUTPUT"
6361 echo "url=$URL" >> "$GITHUB_OUTPUT"
64- {
65- echo "body<<BODY_EOF"
66- echo "$BODY"
67- echo "BODY_EOF"
68- } >> "$GITHUB_OUTPUT"
62+ echo "$ISSUE_JSON" | jq -r '.body' > /tmp/issue-body.txt
6963
7064 - name : " Build prompt"
71- env :
72- ISSUE_NUMBER : ${{ inputs.issue-number }}
73- ISSUE_TITLE : ${{ steps.issue.outputs.title }}
74- ISSUE_URL : ${{ steps.issue.outputs.url }}
75- ISSUE_BODY : ${{ steps.issue.outputs.body }}
7665 run : |
77- python3 << 'PYEOF'
78- import os
79-
80- n = os.environ["ISSUE_NUMBER"]
81- title = os.environ["ISSUE_TITLE"]
82- url = os.environ["ISSUE_URL"]
83- body = os.environ["ISSUE_BODY"]
84-
85- prompt = f"""You are working on phpstan/phpstan-src, the source code of PHPStan - a PHP static analysis tool.
66+ {
67+ cat << 'PROMPT_PART1'
68+ You are working on phpstan/phpstan-src, the source code of PHPStan - a PHP static analysis tool.
8669
8770 Your task is to fix the following GitHub issue from the phpstan/phpstan repository:
88- Issue phpstan/phpstan#{n}: { title}
89- URL: { url}
71+ Issue phpstan/phpstan#${{ inputs.issue-number }}: ${{ steps.issue.outputs. title } }
72+ URL: ${{ steps.issue.outputs. url } }
9073
9174 Issue body:
92- {body}
75+ PROMPT_PART1
76+ cat /tmp/issue-body.txt
77+ cat << 'PROMPT_PART2'
9378
9479 ## Step 1: Write a regression test
9580
@@ -149,14 +134,11 @@ jobs:
149134 ## Test
150135 Describe the regression test that was added.
151136
152- Fixes phpstan/phpstan#{n }
137+ Fixes phpstan/phpstan#${{ inputs.issue-number } }
153138
154139 These files are critical - they will be used for the commit message and PR description.
155- """
156-
157- with open("/tmp/claude-prompt.txt", "w") as f:
158- f.write(prompt)
159- PYEOF
140+ PROMPT_PART2
141+ } > /tmp/claude-prompt.txt
160142
161143 - name : " Run Claude Code"
162144 env :
0 commit comments