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 24, 2024
1 parent f7d7f4e commit 9abe5ab
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/create-jira-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
run: |
ISSUE_TITLE="${{ github.event.issue.title }}"
ISSUE_BODY="${{ github.event.issue.body }}"
echo "Creating Jira issue with title: $ISSUE_TITLE and body: $ISSUE_BODY"
RESPONSE=$(curl -D- \
-u "$JIRA_EMAIL:$JIRA_API_TOKEN" \
-X POST \
Expand All @@ -43,8 +44,8 @@ jobs:
}' \
-H "Content-Type: application/json" \
"$JIRA_BASE_URL/rest/api/2/issue/")
echo "$RESPONSE"
JIRA_ISSUE_KEY=$(echo "$RESPONSE" | grep -oP '(?<=issue\/key\/)\w+-\d+')
echo "Jira API response: $RESPONSE"
JIRA_ISSUE_KEY=$(echo "$RESPONSE" | grep -oP '(?<=key\":\")\w+-\d+')
echo "JIRA_ISSUE_KEY=$JIRA_ISSUE_KEY" >> $GITHUB_ENV
- name: Create branch for the issue
Expand All @@ -57,12 +58,6 @@ jobs:
git checkout -b "$BRANCH_NAME"
git push origin "$BRANCH_NAME"
- name: Add Jira issue key to commit message
env:
JIRA_ISSUE_KEY: ${{ env.JIRA_ISSUE_KEY }}
run: |
echo "JIRA_ISSUE_KEY=${JIRA_ISSUE_KEY}" >> $GITHUB_ENV
update_jira:
if: github.event_name == 'push'
runs-on: ubuntu-latest
Expand Down

0 comments on commit 9abe5ab

Please sign in to comment.