Conversation
Walkthrough브랜치 생성 이벤트에서 브랜치명으로부터 Jira 이슈 키를 추출해 Jira API로 요약·렌더된 설명을 조회하고, 중복 검사를 거쳐 GitHub 이슈를 생성한 뒤 해당 GitHub 이슈 링크를 Jira 이슈에 댓글로 남기는 워크플로우가 추가되었고, 기존의 GitHub 이슈 기반 Jira 생성 워크플로우는 삭제되었습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant Branch as Branch 생성 (Git)
participant GH_Actions as GitHub Actions
participant Jira as Jira REST API
participant GitHub as GitHub Search/Issues API
Branch->>GH_Actions: 브랜치 생성 이벤트 (ref_type=branch)
GH_Actions->>GH_Actions: 브랜치명에서 Jira 키 추출 (정규식)
alt 키 없음
GH_Actions->>GH_Actions: jira_key 출력 빈값, 작업 종료(스킵)
else 키 존재
GH_Actions->>Jira: GET /issue/{KEY}?expand=renderedFields
Jira-->>GH_Actions: summary, rendered description, parent.key
GH_Actions->>GitHub: Search issues/PRs for KEY (중복 검사)
GitHub-->>GH_Actions: 검색 결과
alt 중복 존재
GH_Actions->>GitHub: 이슈 생성 및 Jira 댓글 생략
else 중복 없음
GH_Actions->>GitHub: Create Issue [KEY] {SUMMARY} (body 포함)
GitHub-->>GH_Actions: Issue URL/번호
GH_Actions->>Jira: POST comment with Issue URL
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
.github/workflows/create-github-issue-from-jira-branch.yml (1)
20-22: Jira 키 정규식을 기존 자동화와 맞춰 주세요.여기서는
([A-Z][A-Z0-9]+-[0-9]+)를 쓰지만,.husky/commit-msg와.github/workflows/close-jira-issue.yml은[A-Z]+-[0-9]+를 기준으로 키를 추출합니다. 지금처럼 패턴이 다르면 이 워크플로가 만든 이슈 제목의 키를 닫기 워크플로가 다시 읽지 못하는 경우가 생깁니다.정규식 일관성 맞추기
- if [[ "$BRANCH_NAME" =~ ([A-Z][A-Z0-9]+-[0-9]+) ]]; then + if [[ "$BRANCH_NAME" =~ ([A-Z]+-[0-9]+) ]]; then🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/create-github-issue-from-jira-branch.yml around lines 20 - 22, The branch-to-Jira-key regex currently used when extracting BRANCH_NAME into BASH_REMATCH (pattern `([A-Z][A-Z0-9]+-[0-9]+)`) differs from the other workflows; update the pattern to use the same Jira-key format `[A-Z]+-[0-9]+` so the echo "jira_key=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT" produces keys compatible with `.husky/commit-msg` and the `close-jira-issue.yml` workflow; adjust the conditional that tests BRANCH_NAME (the regex in the if [[ "$BRANCH_NAME" =~ ... ]]) to use `[A-Z]+-[0-9]+`.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/create-github-issue-from-jira-branch.yml:
- Around line 58-63: The heredoc uses a fixed delimiter "EOF" which can collide
with user-provided DESCRIPTION_HTML; instead generate a unique delimiter (e.g.,
DELIM=$(uuidgen) or a timestamp/random suffix), export or set it locally, and
use it in the heredoc invocation (description_html<<"$DELIM") and its terminator
to safely write DESCRIPTION_HTML to $GITHUB_OUTPUT; reference the existing
variables SUMMARY, DESCRIPTION_HTML and GITHUB_OUTPUT and replace the fixed
"EOF" usage with the generated DELIM so the heredoc opener and closer match and
cannot appear inside DESCRIPTION_HTML.
- Around line 73-79: Search currently only checks body for the JIRA_KEY marker
(variable jiraKey) when calling github.rest.search.issuesAndPullRequests, so
duplicates in titles or other formats are missed; update the query string q to
search both title and body for the marker and the plain Jira key (use in:title
and in:body with both "JIRA_KEY: ${jiraKey}" and "${jiraKey}") so duplicates are
detected in either title or body before creating a new issue.
---
Nitpick comments:
In @.github/workflows/create-github-issue-from-jira-branch.yml:
- Around line 20-22: The branch-to-Jira-key regex currently used when extracting
BRANCH_NAME into BASH_REMATCH (pattern `([A-Z][A-Z0-9]+-[0-9]+)`) differs from
the other workflows; update the pattern to use the same Jira-key format
`[A-Z]+-[0-9]+` so the echo "jira_key=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT"
produces keys compatible with `.husky/commit-msg` and the `close-jira-issue.yml`
workflow; adjust the conditional that tests BRANCH_NAME (the regex in the if [[
"$BRANCH_NAME" =~ ... ]]) to use `[A-Z]+-[0-9]+`.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: eb552111-800d-420f-a731-c778f49f5a88
📒 Files selected for processing (2)
.github/workflows/create-github-issue-from-jira-branch.yml.github/workflows/create-jira-issue.yml
💤 Files with no reviewable changes (1)
- .github/workflows/create-jira-issue.yml
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
.github/workflows/create-github-issue-from-jira-branch.yml (1)
79-88:⚠️ Potential issue | 🟠 Major중복 판정이 아직도 현재 생성 포맷에 과하게 묶여 있습니다.
Line 79는 Jira 키가 들어간 이슈를 넓게 찾지만, Line 85-87은 제목이 정확히
[KEY]로 시작하거나 본문에JIRA_KEY:마커가 있는 경우만 기존 이슈로 인정합니다. 그래서 수동 생성 이슈나 이전 포맷 이슈처럼 제목/본문에 Jira 키만 들어있는 경우에는 같은 Jira 키로 새 이슈를 또 만들 수 있습니다.수정 예시
const existing = result.data.items.find((item) => !item.pull_request && - (item.title.startsWith(`[${jiraKey}]`) || item.body?.includes(marker)) + ( + item.title?.includes(jiraKey) || + item.body?.includes(marker) || + item.body?.includes(jiraKey) + ) );🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/create-github-issue-from-jira-branch.yml around lines 79 - 88, The duplicate-detection is too strict: while the search q uses the jiraKey, the existing check only accepts titles that startWith(`[${jiraKey}]`) or bodies containing marker, so issues with the jiraKey elsewhere in title/body are missed. Update the existing detection (where result and existing are used) to treat any non-pull-request item whose title or body contains the jiraKey (case-insensitive) OR whose body contains marker as a duplicate; keep the existing pull_request filter and preserve the original exact-startsWith check if desired, but broaden to title?.includes(jiraKey) and body?.includes(jiraKey) to avoid creating duplicate issues.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/create-github-issue-from-jira-branch.yml:
- Around line 118-127: The "브랜치명" section currently prints the computed
recommendedBranch (`recommendedBranch`) instead of the actual branch created by
the event; either replace `recommendedBranch` with the real branch variable used
by the workflow (e.g., `BRANCH_NAME` / the runtime branch ref) when building the
`body` array so the issue shows the actual created branch, or alternatively
change the heading text to "권장 브랜치명 (Recommended branch)" to reflect that the
value is only a suggestion; update the `body` element that currently contains ``
`${recommendedBranch}` `` accordingly and ensure any environment or action
output variable used (e.g., `BRANCH_NAME` or github.ref) is referenced
consistently.
- Around line 48-52: The API call that builds RESPONSE uses
fields=summary,description but then reads .fields.parent.key into PARENT_KEY, so
update the request URL (the call using
"${JIRA_BASE_URL}/rest/api/3/issue/${JIRA_KEY}?fields=...") to include parent in
the fields query (e.g., fields=summary,description,parent) so PARENT_KEY (and
any parent data) is returned; adjust only the fields parameter in the request
that sets RESPONSE so SUMMARY, DESCRIPTION_HTML and PARENT_KEY work correctly.
---
Duplicate comments:
In @.github/workflows/create-github-issue-from-jira-branch.yml:
- Around line 79-88: The duplicate-detection is too strict: while the search q
uses the jiraKey, the existing check only accepts titles that
startWith(`[${jiraKey}]`) or bodies containing marker, so issues with the
jiraKey elsewhere in title/body are missed. Update the existing detection (where
result and existing are used) to treat any non-pull-request item whose title or
body contains the jiraKey (case-insensitive) OR whose body contains marker as a
duplicate; keep the existing pull_request filter and preserve the original
exact-startsWith check if desired, but broaden to title?.includes(jiraKey) and
body?.includes(jiraKey) to avoid creating duplicate issues.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 4962f189-8a02-4139-b2d5-88742870329b
📒 Files selected for processing (1)
.github/workflows/create-github-issue-from-jira-branch.yml
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/create-github-issue-from-jira-branch.yml:
- Around line 68-95: The deduplication (search -> create) is not atomic and can
race; split the workflow into two jobs: an extract_jira_key job that runs the
existing extract step and sets outputs.jira_key, and a follow-up
create_github_issue job (which runs the dedup/search and create logic currently
in the same file, including the step id dedup and outputs 'exists'/'number')
that declares needs: extract_jira_key and a concurrency section such as
concurrency.group: jira-issue-${{ needs.extract_jira_key.outputs.jira_key }} to
serialize runs for the same Jira key; this ensures the github-script search in
the dedup step cannot be run in parallel with another run for the same key and
prevents duplicate issue creation.
- Around line 45-48: The two curl invocations that populate RESPONSE (the
command using "${JIRA_BASE_URL}/rest/api/3/issue/${JIRA_KEY}?...") and the other
curl around lines 188-194 lack connection and overall timeouts and retries;
update both curl calls to include sensible timeouts (e.g., --connect-timeout and
--max-time) and limited retry behavior (e.g., --retry, --retry-delay,
--retry-connrefused) so the workflow doesn't hang indefinitely, while preserving
the existing -sS --fail and authentication headers and existing failure
handling.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: d43adcb4-09b4-48d8-a0c0-38d1a323b084
📒 Files selected for processing (1)
.github/workflows/create-github-issue-from-jira-branch.yml
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/create-github-issue-from-jira-branch.yml (1)
21-25: 보안 모범 사례:github.event.ref를 환경 변수로 전달하세요.
${{ github.event.ref }}를run:블록에서 직접 보간하면 이론적으로 쉘 주입 위험이 있습니다. Git 브랜치 이름 제약으로 실제 악용은 어렵지만, 환경 변수를 사용하는 것이 더 안전합니다.♻️ 환경 변수 사용 예시
- name: Extract Jira key from branch name id: extract shell: bash + env: + REF_NAME: ${{ github.event.ref }} run: | - BRANCH_NAME="${{ github.event.ref }}" + BRANCH_NAME="$REF_NAME" if [[ "$BRANCH_NAME" =~ ([A-Z][A-Z0-9]+-[0-9]+) ]]; then🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/create-github-issue-from-jira-branch.yml around lines 21 - 25, Replace direct interpolation of ${{ github.event.ref }} inside the run block with an environment variable and reference that variable in the shell to avoid shell-injection risks: set an env like BRANCH_REF: ${{ github.event.ref }} in the job/step env, then in the run script use BRANCH_NAME="$BRANCH_REF" (and keep the existing BASH_REMATCH extraction and echo to GITHUB_OUTPUT for jira_key and branch_name) so the code uses the environment variable instead of direct workflow expression interpolation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/create-github-issue-from-jira-branch.yml:
- Around line 21-25: Replace direct interpolation of ${{ github.event.ref }}
inside the run block with an environment variable and reference that variable in
the shell to avoid shell-injection risks: set an env like BRANCH_REF: ${{
github.event.ref }} in the job/step env, then in the run script use
BRANCH_NAME="$BRANCH_REF" (and keep the existing BASH_REMATCH extraction and
echo to GITHUB_OUTPUT for jira_key and branch_name) so the code uses the
environment variable instead of direct workflow expression interpolation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: aa15626f-c0c2-4ad0-8125-85aec4f4f439
📒 Files selected for processing (1)
.github/workflows/create-github-issue-from-jira-branch.yml
📝 작업 내용
Summary by CodeRabbit
개선 사항
정리(Chores)