File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -80,11 +80,25 @@ jobs:
8080 JIRA_KEY : ${{ steps.create.outputs.jira_key }}
8181 ISSUE_TITLE : ${{ github.event.issue.title }}
8282 run : |
83+ TITLE=$(echo "${ISSUE_TITLE//`/\\`}" | sed 's/"/\\"/g' | sed "s/'/\\\'/g")
84+ PAYLOAD=$(jq -n \
85+ --arg issuetitle "$TITLE" \
86+ --arg jirakey "$JIRA_KEY" \
87+ '{
88+ title: ($jirakey + ": " + $issuetitle)
89+ }')
90+
8391 # Update Github issue title with jira id
84- GH_UPD_RESPONSE=$( curl -s \
92+ curl -s \
8593 -X PATCH \
8694 -H "Authorization: Bearer $GITHUB_TOKEN" \
8795 -H "Accept: application/vnd.github+json" \
8896 -H "X-GitHub-Api-Version: 2022-11-28" \
8997 "https://api.github.com/repos/$REPOSITORY/issues/$ISSUE_NUMBER" \
90- -d "{\"title\":\"$JIRA_KEY: $ISSUE_TITLE\"}")
98+ -d "$PAYLOAD"
99+
100+ if [ "$?" != 0 ]; then
101+ echo "Failed to update GH issue. Payload was:"
102+ echo "$PAYLOAD"
103+ exit 1
104+ fi
You can’t perform that action at this time.
0 commit comments