Skip to content

Commit

Permalink
chore add log
Browse files Browse the repository at this point in the history
  • Loading branch information
Guri999 committed Jan 30, 2025
1 parent c18f2a1 commit 055e32d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/update-jira.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,22 @@ jobs:
run: |
JIRA_ENTRIES=""
while IFS= read -r COMMIT_MSG; do
JIRA_ID=$(echo "$COMMIT_MSG" | grep -oE '#[^ ]+' | head -n 1 | tr -d '#')
JIRA_ID=$(echo "$COMMIT_MSG" | grep -oE '#[A-Za-z0-9-]+' | head -n 1 | tr -d '#')
if [[ -n "$JIRA_ID" ]]; then
echo "Extracted Jira ID: $JIRA_ID"
JIRA_RESPONSE=$(
curl -s -u "${{ secrets.JIRA_GURI }}:${{ secrets.JIRA_GURI_TOKEN }}" \
-X GET -H "Accept: application/json" \
"${{ secrets.JIRA_DOMAIN }}/rest/api/2/issue/$JIRA_ID"
)
echo "$JIRA_RESPONSE" > jira_response.json
cat jira_response.json
JIRA_TITLE=$(echo "$JIRA_RESPONSE" | jq -r '.fields.summary')
JIRA_LINK="${{ secrets.JIRA_DOMAIN }}/browse/$JIRA_ID"
echo "Updating Jira ticket status for: JIRA_LINK"
JIRA_ENTRIES+="\n$COMMIT_MSG #$JIRA_ID\n- [**$JIRA_TITLE**]($JIRA_LINK)"
curl -s -u "${{ secrets.JIRA_GURI }}:${{ secrets.JIRA_GURI_TOKEN }}" \
Expand Down

0 comments on commit 055e32d

Please sign in to comment.