|
60 | 60 | run: | |
61 | 61 | ENHANCED_TASK="${{ steps.preprocess.outputs.enhanced_task }}" |
62 | 62 | ORIGINAL_TASK="${{ github.event.client_payload.task }}" |
63 | | - |
| 63 | + REQUESTER="${{ github.event.client_payload.requester }}" |
| 64 | + CHANNEL="${{ github.event.client_payload.channel }}" |
| 65 | + TIMESTAMP="${{ github.event.client_payload.timestamp }}" |
| 66 | + RUN_ID="${{ github.run_id }}" |
| 67 | +
|
64 | 68 | # Use jq to properly construct JSON payload with proper escaping |
65 | 69 | PAYLOAD=$(jq -n \ |
66 | 70 | --arg event_type "aicode-enhanced" \ |
|
81 | 85 | preprocessing_run_id: $preprocessing_run_id |
82 | 86 | } |
83 | 87 | }') |
84 | | - |
85 | | - curl -X POST "https://api.github.com/repos/${{ github.repository }}/dispatches" \ |
86 | | - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ |
87 | | - -H "Accept: application/vnd.github+json" \ |
88 | | - -H "Content-Type: application/json" \ |
89 | | - -d "$PAYLOAD" 's/"/\\"/g' | sed ':a;N;$!ba;s/\n/\\n/g') |
90 | | - ORIGINAL_TASK_ESCAPED=$(echo "$ORIGINAL_TASK" | sed 's/"/\\"/g') |
91 | | - |
| 88 | +
|
92 | 89 | curl -X POST "https://api.github.com/repos/${{ github.repository }}/dispatches" \ |
93 | 90 | -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ |
94 | 91 | -H "Accept: application/vnd.github+json" \ |
95 | 92 | -H "Content-Type: application/json" \ |
96 | | - -d "{ |
97 | | - \"event_type\": \"aicode-enhanced\", |
98 | | - \"client_payload\": { |
99 | | - \"task\": \"$ENHANCED_TASK_ESCAPED\", |
100 | | - \"original_task\": \"$ORIGINAL_TASK_ESCAPED\", |
101 | | - \"requester\": \"${{ github.event.client_payload.requester }}\", |
102 | | - \"channel\": \"${{ github.event.client_payload.channel }}\", |
103 | | - \"timestamp\": \"${{ github.event.client_payload.timestamp }}\", |
104 | | - \"preprocessing_run_id\": \"${{ github.run_id }}\" |
105 | | - } |
106 | | - }" |
107 | | -
|
108 | | - - name: Notify Slack on preprocessing completion |
109 | | - if: always() |
110 | | - run: | |
111 | | - if [ "${{ steps.preprocess.outcome }}" == "success" ]; then |
112 | | - curl -X POST "${{ secrets.SLACK_WEBHOOK_URL }}" \ |
113 | | - -H "Content-Type: application/json" \ |
114 | | - -d "{\"text\":\"📝 Task preprocessed and enhanced. Triggering code generation...\",\"blocks\":[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"📝 *Task Preprocessing Complete*\\n\\n*Original:* ${{ github.event.client_payload.task }}\\n\\n*Enhanced:* ${{ steps.preprocess.outputs.enhanced_task }}\"}}]}" |
115 | | - else |
116 | | - curl -X POST "${{ secrets.SLACK_WEBHOOK_URL }}" \ |
117 | | - -H "Content-Type: application/json" \ |
118 | | - -d "{\"text\":\"⚠️ Preprocessing failed, using original task\",\"blocks\":[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"⚠️ *Preprocessing Warning*\\n\\nPreprocessing failed, but code generation will continue with original task.\"}}]}" |
119 | | - fi |
120 | | - env: |
121 | | - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
| 93 | + -d "$PAYLOAD" |
0 commit comments