-
Notifications
You must be signed in to change notification settings - Fork 0
chore: QA 이슈 생성 시 기존 Jira 티켓 자동 연동 워크플로우 추가 #207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6e9c43e
[BOOK-418] chore: QA용 이슈 템플릿 추가
seoyoon513 aa98379
[BOOK-418] chore: QA 이슈 Jira 연동 워크플로우 추가
seoyoon513 8f8fcbc
[BOOK-418] chore: QA 이슈 템플릿에서 fix 라벨 제거
seoyoon513 a41b748
[BOOK-418] chore: QA 이슈 템플릿에서 fix 라벨 제거 롤백
seoyoon513 01625ad
[BOOK-418] chore: 이슈 제목 기존 형식과 동일하게 업데이트
seoyoon513 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| name: QA Task | ||
| description: QA용 이슈 템플릿입니다.(기존 JIRA의 이슈와 연동됩니다) | ||
| title: "fix] " | ||
| labels: ["🐞 fix", "qa"] | ||
| body: | ||
| - type: input | ||
| id: parentKey | ||
| attributes: | ||
| label: '🎟️ 작업 (Ticket Number)' | ||
| description: '연동할 작업의 Ticket Number를 기입해주세요' | ||
| placeholder: 'BOOK-00' | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: input | ||
| id: description | ||
| attributes: | ||
| label: "🐞 버그 설명" | ||
| description: "어떤 버그인지 명확히 작성해주세요" | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: tasks | ||
| attributes: | ||
| label: "🔧 수정할 작업 목록" | ||
| description: "수정해야 할 항목들을 체크리스트로 작성해주세요" | ||
| value: | | ||
| - [ ] 버그 재현 | ||
| - [ ] 원인 분석 | ||
| - [ ] 수정 및 테스트 | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: input | ||
| id: links | ||
| attributes: | ||
| label: "🔗 참고 링크" | ||
| description: "관련 문서, 스크린샷, 로그 등이 있다면 첨부해주세요 (선택)" | ||
| placeholder: "https://..." | ||
| validations: | ||
| required: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,154 +1,156 @@ | ||
| name: Create Jira Issue | ||
| on: | ||
| issues: | ||
| types: | ||
| - opened | ||
| issues: | ||
| types: | ||
| - opened | ||
|
|
||
| jobs: | ||
| create-issue: | ||
| name: Create Jira issue | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Determine Issue Type | ||
| id: type | ||
| run: | | ||
| if echo "${{ toJson(github.event.issue.labels) }}" | grep -q '✨ feat'; then | ||
| echo "type=feature" >> $GITHUB_OUTPUT | ||
| echo "template=feature-task.yml" >> $GITHUB_OUTPUT | ||
| elif echo "${{ toJson(github.event.issue.labels) }}" | grep -q '🐞 fix'; then | ||
| echo "type=fix" >> $GITHUB_OUTPUT | ||
| echo "template=fix-task.yml" >> $GITHUB_OUTPUT | ||
| elif echo "${{ toJson(github.event.issue.labels) }}" | grep -q '🔨 refactor'; then | ||
| echo "type=refactor" >> $GITHUB_OUTPUT | ||
| echo "template=refactor-task.yml" >> $GITHUB_OUTPUT | ||
| elif echo "${{ toJson(github.event.issue.labels) }}" | grep -q '📃 docs'; then | ||
| echo "type=docs" >> $GITHUB_OUTPUT | ||
| echo "template=docs-task.yml" >> $GITHUB_OUTPUT | ||
| elif echo "${{ toJson(github.event.issue.labels) }}" | grep -q '⚙️ chore'; then | ||
| echo "type=chore" >> $GITHUB_OUTPUT | ||
| echo "template=chore-task.yml" >> $GITHUB_OUTPUT | ||
| elif echo "${{ toJson(github.event.issue.labels) }}" | grep -q '✅ test'; then | ||
| echo "type=test" >> $GITHUB_OUTPUT | ||
| echo "template=test-task.yml" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "type=feature" >> $GITHUB_OUTPUT | ||
| echo "template=feature-task.yml" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Clean Issue Title (for Jira Summary) | ||
| id: clean | ||
| run: | | ||
| raw="${{ github.event.issue.title }}" | ||
| # Remove prefix like 'feat]', 'fix]', 'chore]', etc. | ||
| clean_title=$(echo "$raw" | sed -E 's/^[a-z]+\]\s*//I') | ||
| echo "title=$clean_title" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Jira Login | ||
| uses: atlassian/gajira-login@v3 | ||
| env: | ||
| JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} | ||
| JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} | ||
| JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} | ||
|
|
||
| - name: Checkout main code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: develop | ||
|
|
||
| - name: Parse Issue | ||
| uses: stefanbuck/github-issue-parser@v3 | ||
| id: issue-parser | ||
| with: | ||
| template-path: .github/ISSUE_TEMPLATE/${{ steps.type.outputs.template }} | ||
|
|
||
| - name: Convert markdown to Jira Syntax | ||
| uses: peter-evans/jira2md@v1 | ||
| id: md2jira | ||
| with: | ||
| input-text: | | ||
| ### Github Issue Link | ||
| - ${{ github.event.issue.html_url }} | ||
|
|
||
| ### 기능 설명 | ||
| ${{ steps.issue-parser.outputs.issueparser_description }} | ||
|
|
||
| ### 작업 목록 | ||
| ${{ steps.issue-parser.outputs.issueparser_tasks }} | ||
|
|
||
| ### 참고 링크 | ||
| ${{ steps.issue-parser.outputs.issueparser_links }} | ||
| mode: md2jira | ||
|
|
||
| - name: Create Issue | ||
| id: create | ||
| uses: atlassian/gajira-create@v3 | ||
| with: | ||
| project: BOOK | ||
| issuetype: 하위 작업 | ||
| summary: '${{ steps.clean.outputs.title }}' | ||
| description: '${{ steps.md2jira.outputs.output-text }}' | ||
| fields: | | ||
| { | ||
| "parent": { | ||
| "key": "${{ steps.issue-parser.outputs.issueparser_parentKey }}" | ||
| } | ||
| } | ||
|
|
||
| - name: Checkout both branches | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Switch to develop | ||
| run: | | ||
| git fetch origin develop | ||
| git checkout develop | ||
|
|
||
| - name: Generate Branch Name | ||
| id: branch | ||
| run: | | ||
| issue_number=${{ github.event.issue.number }} | ||
| issue_title="${{ github.event.issue.title }}" | ||
| slug=$(echo "$issue_title" | tr '[:upper:]' '[:lower:]' | sed 's/ /-/g' | sed 's/[^a-z0-9\-]//g') | ||
| ticket_key="${{ steps.create.outputs.issue }}" | ||
| branch_name="${ticket_key}-${{ steps.type.outputs.type }}/#${issue_number}" | ||
| echo "branch=${branch_name}" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Create and push branch | ||
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| git checkout -b "${{ steps.branch.outputs.branch }}" | ||
| git push origin "${{ steps.branch.outputs.branch }}" | ||
|
|
||
| - name: Update issue title | ||
| uses: actions-cool/issues-helper@v3 | ||
| with: | ||
| actions: 'update-issue' | ||
| token: ${{ secrets.PAT_TOKEN }} | ||
| title: '[${{ steps.create.outputs.issue }}/${{ github.event.issue.title }}' | ||
|
|
||
| - name: Add comment with Jira issue link | ||
| uses: actions-cool/issues-helper@v3 | ||
| with: | ||
| actions: 'create-comment' | ||
| token: ${{ secrets.PAT_TOKEN }} | ||
| issue-number: ${{ github.event.issue.number }} | ||
| body: 'Jira Issue Created: [${{ steps.create.outputs.issue }}](${{ secrets.JIRA_BASE_URL }}/browse/${{ steps.create.outputs.issue }})' | ||
|
|
||
| - name: Add comment with Branch Name | ||
| uses: actions-cool/issues-helper@v3 | ||
| with: | ||
| actions: 'create-comment' | ||
| token: ${{ secrets.PAT_TOKEN }} | ||
| issue-number: ${{ github.event.issue.number }} | ||
| body: '🔀 Branch Created: `${{ steps.branch.outputs.branch }}`' | ||
|
|
||
| - name: Assign issue author | ||
| uses: actions-cool/issues-helper@v3 | ||
| with: | ||
| actions: 'add-assignees' | ||
| token: ${{ secrets.PAT_TOKEN }} | ||
| issue-number: ${{ github.event.issue.number }} | ||
| assignees: ${{ github.event.issue.user.login }} | ||
| create-issue: | ||
| # qa 라벨이 없을 때만 Jira issue 생성 | ||
| if: contains(github.event.issue.labels.*.name, 'qa') == false | ||
| name: Create Jira issue | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Determine Issue Type | ||
| id: type | ||
| run: | | ||
| if echo "${{ toJson(github.event.issue.labels) }}" | grep -q '✨ feat'; then | ||
| echo "type=feature" >> $GITHUB_OUTPUT | ||
| echo "template=feature-task.yml" >> $GITHUB_OUTPUT | ||
| elif echo "${{ toJson(github.event.issue.labels) }}" | grep -q '🐞 fix'; then | ||
| echo "type=fix" >> $GITHUB_OUTPUT | ||
| echo "template=fix-task.yml" >> $GITHUB_OUTPUT | ||
| elif echo "${{ toJson(github.event.issue.labels) }}" | grep -q '🔨 refactor'; then | ||
| echo "type=refactor" >> $GITHUB_OUTPUT | ||
| echo "template=refactor-task.yml" >> $GITHUB_OUTPUT | ||
| elif echo "${{ toJson(github.event.issue.labels) }}" | grep -q '📃 docs'; then | ||
| echo "type=docs" >> $GITHUB_OUTPUT | ||
| echo "template=docs-task.yml" >> $GITHUB_OUTPUT | ||
| elif echo "${{ toJson(github.event.issue.labels) }}" | grep -q '⚙️ chore'; then | ||
| echo "type=chore" >> $GITHUB_OUTPUT | ||
| echo "template=chore-task.yml" >> $GITHUB_OUTPUT | ||
| elif echo "${{ toJson(github.event.issue.labels) }}" | grep -q '✅ test'; then | ||
| echo "type=test" >> $GITHUB_OUTPUT | ||
| echo "template=test-task.yml" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "type=feature" >> $GITHUB_OUTPUT | ||
| echo "template=feature-task.yml" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Clean Issue Title (for Jira Summary) | ||
| id: clean | ||
| run: | | ||
| raw="${{ github.event.issue.title }}" | ||
| # Remove prefix like 'feat]', 'fix]', 'chore]', etc. | ||
| clean_title=$(echo "$raw" | sed -E 's/^[a-z]+\]\s*//I') | ||
| echo "title=$clean_title" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Jira Login | ||
| uses: atlassian/gajira-login@v3 | ||
| env: | ||
| JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} | ||
| JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} | ||
| JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} | ||
|
|
||
| - name: Checkout main code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: develop | ||
|
|
||
| - name: Parse Issue | ||
| uses: stefanbuck/github-issue-parser@v3 | ||
| id: issue-parser | ||
| with: | ||
| template-path: .github/ISSUE_TEMPLATE/${{ steps.type.outputs.template }} | ||
|
|
||
| - name: Convert markdown to Jira Syntax | ||
| uses: peter-evans/jira2md@v1 | ||
| id: md2jira | ||
| with: | ||
| input-text: | | ||
| ### Github Issue Link | ||
| - ${{ github.event.issue.html_url }} | ||
|
|
||
| ### 기능 설명 | ||
| ${{ steps.issue-parser.outputs.issueparser_description }} | ||
|
|
||
| ### 작업 목록 | ||
| ${{ steps.issue-parser.outputs.issueparser_tasks }} | ||
|
|
||
| ### 참고 링크 | ||
| ${{ steps.issue-parser.outputs.issueparser_links }} | ||
| mode: md2jira | ||
|
|
||
| - name: Create Issue | ||
| id: create | ||
| uses: atlassian/gajira-create@v3 | ||
| with: | ||
| project: BOOK | ||
| issuetype: 하위 작업 | ||
| summary: '${{ steps.clean.outputs.title }}' | ||
| description: '${{ steps.md2jira.outputs.output-text }}' | ||
| fields: | | ||
| { | ||
| "parent": { | ||
| "key": "${{ steps.issue-parser.outputs.issueparser_parentKey }}" | ||
| } | ||
| } | ||
|
|
||
| - name: Checkout both branches | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Switch to develop | ||
| run: | | ||
| git fetch origin develop | ||
| git checkout develop | ||
|
|
||
| - name: Generate Branch Name | ||
| id: branch | ||
| run: | | ||
| issue_number=${{ github.event.issue.number }} | ||
| issue_title="${{ github.event.issue.title }}" | ||
| slug=$(echo "$issue_title" | tr '[:upper:]' '[:lower:]' | sed 's/ /-/g' | sed 's/[^a-z0-9\-]//g') | ||
| ticket_key="${{ steps.create.outputs.issue }}" | ||
| branch_name="${ticket_key}-${{ steps.type.outputs.type }}/#${issue_number}" | ||
| echo "branch=${branch_name}" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Create and push branch | ||
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| git checkout -b "${{ steps.branch.outputs.branch }}" | ||
| git push origin "${{ steps.branch.outputs.branch }}" | ||
|
|
||
| - name: Update issue title | ||
| uses: actions-cool/issues-helper@v3 | ||
| with: | ||
| actions: 'update-issue' | ||
| token: ${{ secrets.PAT_TOKEN }} | ||
| title: '[${{ steps.create.outputs.issue }}/${{ github.event.issue.title }}' | ||
|
|
||
| - name: Add comment with Jira issue link | ||
| uses: actions-cool/issues-helper@v3 | ||
| with: | ||
| actions: 'create-comment' | ||
| token: ${{ secrets.PAT_TOKEN }} | ||
| issue-number: ${{ github.event.issue.number }} | ||
| body: 'Jira Issue Created: [${{ steps.create.outputs.issue }}](${{ secrets.JIRA_BASE_URL }}/browse/${{ steps.create.outputs.issue }})' | ||
|
|
||
| - name: Add comment with Branch Name | ||
| uses: actions-cool/issues-helper@v3 | ||
| with: | ||
| actions: 'create-comment' | ||
| token: ${{ secrets.PAT_TOKEN }} | ||
| issue-number: ${{ github.event.issue.number }} | ||
| body: '🔀 Branch Created: `${{ steps.branch.outputs.branch }}`' | ||
|
|
||
| - name: Assign issue author | ||
| uses: actions-cool/issues-helper@v3 | ||
| with: | ||
| actions: 'add-assignees' | ||
| token: ${{ secrets.PAT_TOKEN }} | ||
| issue-number: ${{ github.event.issue.number }} | ||
| assignees: ${{ github.event.issue.user.login }} | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub Actions 스크립트 주입 취약점 (Script Injection).
신뢰할 수 없는 입력 값(
github.event.issue.title)을 환경 변수로 전달하고 스크립트에서는 환경 변수를 사용하는 것이 권장 사항입니다. 현재 코드에서${{ github.event.issue.title }}를 직접 인라인 스크립트에 사용하면 명령어 주입 공격에 취약해집니다.run:섹션에서 직접 template 표현식을 사용하지 마시고, 대신env:섹션에서 환경 변수로 설정하고 스크립트에서 참조하세요.Line 43-47 수정 예시:
Line 112-118 수정 예시:
Also applies to: 112-118
🧰 Tools
🪛 actionlint (1.7.8)
43-43: "github.event.issue.title" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/reference/security/secure-use#good-practices-for-mitigating-script-injection-attacks for more details
(expression)