diff --git a/.github/workflows/create_jira_tickets.sh b/.github/workflows/create_jira_tickets.sh index 1fe5978..a43be8c 100755 --- a/.github/workflows/create_jira_tickets.sh +++ b/.github/workflows/create_jira_tickets.sh @@ -1,11 +1,16 @@ #!/bin/bash +echo "Here's the original issue body: ${ISSUE_BODY}" + # Escape double quotes in ISSUE_TITLE ESCAPED_TITLE="${ISSUE_TITLE//\"/\\\"}" # Escape double quotes and newlines in ISSUE_BODY ESCAPED_BODY="${ISSUE_BODY//\"/\\\"}" #ESCAPED_BODY="${ESCAPED_BODY//$'\n'/\\n}" +ESCAPED_BODY=$(echo "$ESCAPED_BODY" | tr -d '\n') + +ESCAPED_BODY="${ESCAPED_BODY} --- [View the original GitHub issue|$GITHUB_ISSUE_URL]" # Use readarray to populate TASKS array directly from matching lines in ISSUE_BODY readarray -t TASKS < <(echo "$ISSUE_BODY" | grep -E '^- \[[ x]\] ') diff --git a/.github/workflows/jira.yaml b/.github/workflows/jira.yaml index d8eb1ab..58f3892 100644 --- a/.github/workflows/jira.yaml +++ b/.github/workflows/jira.yaml @@ -18,5 +18,6 @@ jobs: JIRA_API_TOKEN_DAFYDD: ${{ secrets.JIRA_API_TOKEN_DAFYDD }} ISSUE_TITLE: "${{ github.event.issue.title }}" ISSUE_BODY: "${{ github.event.issue.body }}" + GITHUB_ISSUE_URL: "https://github.com/${{ github.repository }}/issues/${{ github.event.issue.number }}" GITHUB_ASSIGNEE_USERNAME: "${{ github.event.issue.assignee.login }}" run: .github/workflows/create_jira_tickets.sh