File tree Expand file tree Collapse file tree 1 file changed +18
-15
lines changed Expand file tree Collapse file tree 1 file changed +18
-15
lines changed Original file line number Diff line number Diff line change @@ -51,21 +51,24 @@ TITLE=$(echo "$ISSUE_DATA" | jq -r '.title')
5151BODY=$( echo " $ISSUE_DATA " | jq -r ' .body // ""' )
5252LABELS=$( echo " $ISSUE_DATA " | jq -r ' [.labels[].name] | @json' )
5353
54- TITLE_ESCAPED=$( printf ' %s' " $TITLE " | sed ' s/"/\\"/g' | sed ' s/\n/\\n/g' )
55- BODY_ESCAPED=$( printf ' %s' " $BODY " | sed ' s/"/\\"/g' | awk ' {printf "%s\\n", $0}' | sed ' s/\\n$//' )
54+ JSON_PAYLOAD=$( jq -n \
55+ --arg type " github.issue.fix" \
56+ --arg repo " $REPO " \
57+ --argjson issue " $ISSUE_NUMBER " \
58+ --arg title " $TITLE " \
59+ --arg body " $BODY " \
60+ --argjson labels " $LABELS " \
61+ ' {
62+ type: $type,
63+ payload: {
64+ repo: $repo,
65+ issue: $issue,
66+ title: $title,
67+ body: $body,
68+ labels: $labels
69+ }
70+ }' )
5671
57- JSON_PAYLOAD=$( cat << EOF
58- {
59- "type": "github.issue.fix",
60- "payload": {
61- "repo": "$REPO ",
62- "issue": $ISSUE_NUMBER ,
63- "title": "$TITLE_ESCAPED ",
64- "body": "$BODY_ESCAPED ",
65- "labels": $LABELS
66- }
67- }
68- EOF
69- )
72+ echo " curl -X POST \" $JOBS_ENDPOINT \" -H \" Content-Type: application/json\" -d \" $JSON_PAYLOAD \" -w \" \nStatus: %{http_code}\n\n\" "
7073
7174curl -X POST " $JOBS_ENDPOINT " -H " Content-Type: application/json" -d " $JSON_PAYLOAD " -w " \nStatus: %{http_code}\n\n"
You can’t perform that action at this time.
0 commit comments