Skip to content

Commit 742eef3

Browse files
authored
[SD-324] Mutliple ID fix (#58)
* only take 1st match * removed response body echo * clean
1 parent 7db358e commit 742eef3

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

.github/workflows/post_jira_comment.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,11 @@ jobs:
4141
# Handle the API response
4242
if [ "$http_code" -eq 201 ]; then
4343
echo "Comment posted successfully to Jira issue ${{ inputs.jira_id }}"
44-
echo "Response Body: $response_body"
4544
else
4645
echo "Failed to post comment to Jira issue ${{ inputs.jira_id }}. HTTP Code: $http_code"
47-
echo "Response Body: $response_body"
4846
4947
echo '### ⚠️ Failed to post comment to Jira' >> $GITHUB_STEP_SUMMARY
5048
echo "#### Issue ID: ${{ inputs.jira_id }}" >> $GITHUB_STEP_SUMMARY
5149
echo "#### HTTP Code: $http_code" >> $GITHUB_STEP_SUMMARY
5250
echo "#### Response Body: $response_body" >> $GITHUB_STEP_SUMMARY
53-
5451
fi

.github/workflows/test_post_jira.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ jobs:
3333
commit_message=$(echo "$commit_info" | jq -r '.commit.message')
3434
3535
# Extract JIRA ID
36-
JIRA_ID=$(echo "$commit_message" | grep -oE 'SCFA-[0-9]{1,5}' || true) # Prevents non-zero exit code
37-
36+
JIRA_ID=$(echo "$commit_message" | grep -oE 'SCFA-[0-9]{1,5}' | head -n 1 || true)
37+
3838
# Check if JIRA ID is found
3939
if [ -z "$JIRA_ID" ]; then
4040
echo "No JIRA ID found in commit message: $commit_message"

0 commit comments

Comments
 (0)