Skip to content

Commit d53b156

Browse files
committed
sd
1 parent 61bb2b2 commit d53b156

File tree

1 file changed

+15
-20
lines changed

1 file changed

+15
-20
lines changed

.github/workflows/model-pr-adjust.yml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,12 @@ jobs:
4040

4141
- name: Parse instruction
4242
id: instruction
43-
run: |
44-
COMMENT=$(cat <<'COMMENT_EOF'
45-
${{ github.event.comment.body }}
46-
COMMENT_EOF
47-
)
48-
# Strip the /models prefix
49-
INSTRUCTION="${COMMENT#/models }"
50-
echo "instruction<<EOF" >> "$GITHUB_OUTPUT"
51-
echo "$INSTRUCTION" >> "$GITHUB_OUTPUT"
52-
echo "EOF" >> "$GITHUB_OUTPUT"
43+
uses: actions/github-script@v7
44+
with:
45+
script: |
46+
const body = context.payload.comment.body;
47+
const instruction = body.replace(/^\/models\s+/, '');
48+
core.setOutput('instruction', instruction);
5349
5450
- name: React to comment
5551
run: |
@@ -58,10 +54,9 @@ jobs:
5854
env:
5955
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6056

61-
- name: Apply adjustment
62-
id: adjust
57+
- name: Build prompt
6358
run: |
64-
PROMPT="$(cat <<'PROMPT_EOF'
59+
cat > /tmp/prompt.txt <<EOF
6560
You are making a targeted adjustment to AI model configuration files for the Botpress cognitive service.
6661
6762
## Context
@@ -82,21 +77,21 @@ jobs:
8277
8378
## Instruction from reviewer
8479
85-
INSTRUCTION_PLACEHOLDER
80+
${{ steps.instruction.outputs.instruction }}
8681
8782
## Output
8883
8984
After applying changes, write a SHORT summary (2-3 lines) of what you changed to /tmp/adjustment-summary.txt
90-
PROMPT_EOF
91-
)"
85+
EOF
9286
93-
PROMPT="${PROMPT//INSTRUCTION_PLACEHOLDER/${{ steps.instruction.outputs.instruction }}}"
94-
95-
claude --print \
87+
- name: Apply adjustment
88+
id: adjust
89+
run: |
90+
cat /tmp/prompt.txt | claude --print \
9691
--model claude-sonnet-4-6 \
9792
--max-turns 15 \
9893
--allowedTools "Read,Edit,Glob,Grep" \
99-
"$PROMPT" | tee /tmp/claude-output.txt
94+
- | tee /tmp/claude-output.txt
10095
10196
if git diff --quiet; then
10297
echo "has_changes=false" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)