Skip to content

Commit

Permalink
Update create-jira-issue.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
hooni0918 authored Jun 28, 2024
1 parent daccc0a commit b341093
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/create-jira-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,21 @@ jobs:
sync_with_jira:
runs-on: ubuntu-latest
steps:
- name: Setup environment
- name: Sync commits with Jira
run: |
function extract_issue_key_from_commit_message {
echo "$1" | grep -oE 'JIRA-\d+'
}
- name: Sync commits with Jira
run: |
JIRA_ISSUE_KEY=$(extract_issue_key_from_commit_message "${{ github.event.head_commit.message }}")
JIRA_ISSUE_KEY=$(extract_issue_key_from_commit_message "Update create-jira-issue.yml")
if [ -z "$JIRA_ISSUE_KEY" ]; then
echo "No JIRA issue key found in commit message."
exit 1
fi
COMMIT_ID="${{ github.event.head_commit.id }}"
COMMIT_MSG="${{ github.event.head_commit.message }}"
COMMIT_ID="6f2a2640d5fdd55e4fead9548a77940585202111"
COMMIT_MSG="Update create-jira-issue.yml"
curl -u "${{ secrets.JIRA_EMAIL }}:${{ secrets.JIRA_API_TOKEN }}" \
-X POST \
--data "{\"update\": {\"comment\": [{\"add\": {\"body\": \"Commit '$COMMIT_ID' was added to this issue: $COMMIT_MSG\"}}]}}" \
Expand Down

0 comments on commit b341093

Please sign in to comment.