File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88 preprocess :
99 runs-on : ubuntu-latest
1010 permissions :
11- contents : read
11+ contents : write
1212 actions : write
1313
1414 steps :
@@ -135,10 +135,24 @@ jobs:
135135 if : always()
136136 run : |
137137 if [ "${{ steps.preprocess.outcome }}" == "success" ]; then
138- # Use jq to properly construct JSON payload with proper escaping
139- ORIGINAL_TASK="${{ github.event.client_payload.task }}"
140- ENHANCED_TASK="${{ steps.preprocess.outputs.enhanced_task }}"
138+ # Read from JSON file to avoid shell quoting issues
139+ if [ -f /tmp/task_json.json ] && jq -e . /tmp/task_json.json >/dev/null 2>&1; then
140+ # Read from JSON file (safest method)
141+ ORIGINAL_TASK=$(jq -r '.original // empty' /tmp/task_json.json)
142+ ENHANCED_TASK=$(jq -r '.enhanced // empty' /tmp/task_json.json)
143+ else
144+ # Fallback: read original from event, enhanced from file if available
145+ ORIGINAL_TASK="${{ github.event.client_payload.task }}"
146+ # Try to read enhanced_task from file, or use a safe default
147+ if [ -f /tmp/task_json.json ]; then
148+ ENHANCED_TASK=$(jq -r '.enhanced // empty' /tmp/task_json.json || echo "$ORIGINAL_TASK")
149+ else
150+ # Last resort: use original task as enhanced (better than breaking)
151+ ENHANCED_TASK="$ORIGINAL_TASK"
152+ fi
153+ fi
141154
155+ # Use jq to properly construct JSON payload with proper escaping
142156 PAYLOAD=$(jq -n \
143157 --arg text "📝 Task preprocessed and enhanced. Triggering code generation..." \
144158 --arg original "$ORIGINAL_TASK" \
You can’t perform that action at this time.
0 commit comments