Skip to content

Commit

Permalink
link back to github issue
Browse files Browse the repository at this point in the history
  • Loading branch information
“Dafydd committed Oct 31, 2024
1 parent 08009e7 commit 114af4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/create_jira_tickets.sh
Original file line number Diff line number Diff line change
@@ -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]\] ')
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/jira.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 114af4b

Please sign in to comment.