[CI] 이슈 작성자 라벨 자동 부착 자동화 - #9
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughGitHub Actions 자동 라벨링 워크플로우가 pull request와 issue 모두를 처리하도록 확장되었습니다. PR 라벨링 조건과 작성자 처리 흐름이 정리되었고, 이슈 제목 접두사 라벨과 이슈 작성자 라벨 매핑도 조정되었습니다. Changes이슈·PR 자동 라벨링 확장
Sequence Diagram(s)sequenceDiagram
participant GitHub as GitHub Events
participant autoLabel as auto-label.yml
participant labelPR as label-pr
participant labelIssues as label-issues
GitHub->>autoLabel: pull_request opened/synchronize/edited
autoLabel->>labelPR: prefix 및 작성자 라벨 처리
GitHub->>autoLabel: issues opened
autoLabel->>labelIssues: issue 작성자 라벨 처리
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 분 Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/auto-label.yml:
- Around line 9-12: The workflow-level permissions block grants `pull-requests:
write` and `issues: write` to all jobs, which violates the principle of least
privilege. Remove these write permissions from the workflow-level permissions
configuration and instead add job-level `permissions` sections to specify which
specific jobs actually need `pull-requests: write` and `issues: write`
permissions. This ensures only jobs that require these permissions have them,
while keeping the workflow-level permissions restricted to `contents: read`.
- Line 112: Replace the version tag reference in the actions/github-script
action from `@v7` to a pinned commit SHA to reduce supply chain risk. Change
`uses: actions/github-script@v7` to use the full commit SHA `6546db9` which
corresponds to v7.0.0, ensuring the action uses a specific immutable commit
rather than a movable tag.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1953c644-ed07-49f0-9ac3-74396c5e36ba
📒 Files selected for processing (1)
.github/workflows/auto-label.yml
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/auto-label.yml:
- Line 19: Replace the moveable version tag reference in the actions/labeler
action from v5 to a full-length commit SHA to mitigate supply chain risk.
Instead of using `actions/labeler@v5`, pin it to a specific commit SHA (format:
`actions/labeler@<full-40-character-SHA>`) to ensure that the exact version of
the action is always used regardless of any tag movements.
- Around line 15-21: The `label-by-files` job's permissions block is missing a
required permission for the `actions/labeler@v5` action. In the permissions
section of the job that uses `actions/labeler@v5`, add `contents: read`
alongside the existing `pull-requests: write` permission. The labeler action
requires both read access to repository contents and write access to pull
requests to function correctly.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 33e48196-a2b8-402b-be71-c70ed333294f
📒 Files selected for processing (1)
.github/workflows/auto-label.yml
jjangminii
left a comment
There was a problem hiding this comment.
이슈 작성자 라벨 안붙길래 뭐 잘못했나 했는데 아직 머지 안된거였네요 ㅎㅎ
확실히 라벨 자동화하니까 너무 편리해요~ 고생하셨습니당 👍
yumin-kim2
left a comment
There was a problem hiding this comment.
이슈에도 라벨 자동으로 붙는 거 편할 것 같아요! 수고하셨습니다 👍👍
| @@ -86,17 +116,12 @@ jobs: | |||
| 'yumin-kim2': '♣️ 유민', | |||
There was a problem hiding this comment.
엇 label-issues authorMap에 저만 있는 것 같아요..! 나머지 분들 매핑이 빠진 것 같은데 확인 부탁드려요 🙏
- label-pr 잡이 label-by-files 완료 후 실행되도록 needs 의존성을 추가했습니다 - prefix 라벨이 이미 올바르게 설정된 경우 불필요한 remove → add 사이클을 방지했습니다 - 작성자 라벨이 이미 존재하면 재추가하지 않도록 중복 체크를 추가했습니다
- 이슈의 [REFACTOR] prefix 매핑을 🧹 CHORE에서 ♻ Refactor로 수정했습니다
ehye1
left a comment
There was a problem hiding this comment.
두 워크플로우가 동시에 실행돼서 오류가 발생햇던거였군요!!!!
배워갑니다.. 수고하셨어요!!
ISSUE 🔗
close #8
What is this PR? 🔍
auto-label.yml워크플로우에 이슈 작성자별 라벨 자동 부착 기능을 추가하고, 기존 PR 라벨링 job을 통합 및 권한을 정리했습니다. 또한 라벨 중복 처리 및 job 실행 순서 문제를 수정했습니다.이슈 작성자 라벨링 추가
기존 워크플로우는
pull_request이벤트만 처리했기 때문에 이슈 생성 시 작성자 라벨이 자동으로 붙지 않았습니다.on:트리거에issues: [opened]를 추가하고, 이슈 전용label-issuesjob을 새로 만들어 이슈 생성 시에도 동일한 작성자 매핑이 적용되도록 했습니다.job 통합
기존
label-by-prefix와label-by-author가 거의 동일한 조건(!synchronize)으로 별도 job을 차지하면서 GitHub Checks UI에 불필요한 Skipped 항목이 노출됐습니다. 두 job을label-pr하나로 통합하고, 작성자 라벨은 내부 조건(opened / reopened)으로 분기 처리했습니다. 결과적으로 4개 → 3개 job으로 줄었습니다.label-by-fileslabel-by-fileslabel-by-prefixlabel-pr(prefix + author 통합)label-by-author(Skipped 노출)issue-label-by-authorlabel-issues최소 권한 분리
워크플로우 레벨에서
pull-requests: write와issues: write를 모든 job에 부여하던 구조를 개선했습니다. 워크플로우 레벨은contents: read만 유지하고, 각 job에 실제 필요한 권한만 선언했습니다.label-by-files,label-pr→pull-requests: writelabel-issues→issues: write라벨 중복 처리 방지 및 job 순서 보장
label-by-files와label-pr이 병렬로 실행되면서 GitHub API 호출이 뒤섞여 "added병렬 실행 경합:
label-by-files가 라벨을 추가하는 동시에label-pr이 현재 라벨 목록을 읽어 처리하면서 결과가 뒤섞였습니다.label-pr에needs: label-by-files를 추가해 순차 실행으로 변경했습니다.불필요한 remove → add 사이클:
label-pr이 이벤트마다 prefix 라벨을 무조건 제거 후 재추가해, 라벨이 바뀌지 않아도 활동 로그에 노출됐습니다. 현재 붙어있는 라벨과 원하는 라벨이 다를 때만 변경하도록 수정했습니다.작성자 라벨 중복 추가:
reopened이벤트 시 이미 존재하는 작성자 라벨을 다시 추가하면서 활동 로그에 노출됐습니다. 라벨이 없을 때만 추가하도록 수정했습니다.To Reviewers
label-prjob 내부에서 prefix 처리와 author 처리를 순서대로 실행하는 구조입니다.needs: label-by-files로 파일 기반 라벨링이 끝난 뒤 현재 라벨 상태를 읽기 때문에 경합 없이 동작합니다. 라벨 변경 전에 현재 상태를 읽어두는 방식(currentLabelNamesSet)이라 두 처리가 한 스크립트 안에 있어도 일관성이 보장됩니다.Screenshot 📷
Test Checklist ✔
Summary by CodeRabbit
릴리스 노트
[REFACTOR]로 시작하는 이슈 제목에 적용되는 라벨을🧹 CHORE에서♻ Refactor로 변경