Skip to content

chore: PR 라벨링 워크플로우 github-script로 전환#11

Merged
seoyoon513 merged 2 commits intodevelopfrom
BOOK-51-chore/#10
Jun 19, 2025
Merged

chore: PR 라벨링 워크플로우 github-script로 전환#11
seoyoon513 merged 2 commits intodevelopfrom
BOOK-51-chore/#10

Conversation

@seoyoon513
Copy link
Copy Markdown
Contributor

@seoyoon513 seoyoon513 commented Jun 19, 2025

🔗 관련 이슈

📙 작업 설명

  • PR 제목 기반 라벨링 방식으로 변경

💬 추가 설명 or 리뷰 포인트

  • 기존에 사용하던 jimschubert/labeler-action@v2 액션의 라벨 패턴은 제목+설명을 참고하여 할당하기 때문에 의도하지 않은 라벨이 붙는 문제가 있습니다.
  • https://github.com/jimschubert/labeler-action
  • title, scope를 추가하여 PR title로 한정하려 했으나 해당 문법 미지원으로 action이 실패한 것입니다.

Summary by CodeRabbit

  • Chores
    • 자동 PR 라벨링 설정이 외부 액션에서 자체 스크립트 기반 워크플로우로 변경되었습니다.
    • PR 제목에 따라 라벨이 자동으로 지정됩니다.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 19, 2025

Walkthrough

PR 라벨링 자동화 방식이 jimschubert/labeler-action@v2에서 GitHub Actions의 github-script를 활용한 커스텀 스크립트 기반으로 변경되었습니다. 기존의 .github/labeler.yml 설정 파일이 삭제되고, 워크플로우 파일에서 라벨링 로직이 직접 구현되었습니다.

Changes

파일(들) 변경 요약
.github/labeler.yml PR 제목 기반 라벨 자동화 설정 파일 삭제
.github/workflows/PR_Label_Assign.yml 외부 labeler-action 제거, github-script 기반 라벨링 로직 직접 구현 및 워크플로우 수정

Sequence Diagram(s)

sequenceDiagram
    participant GitHub
    participant Workflow (github-script)
    participant PR

    GitHub->>Workflow (github-script): PR 오픈/수정 이벤트 트리거
    Workflow (github-script)->>PR: PR 제목 추출
    Workflow (github-script)->>Workflow (github-script): 정규식 기반 라벨 매칭
    alt 매칭되는 라벨 있음
        Workflow (github-script)->>GitHub: PR에 라벨 추가 API 호출
    else 매칭되는 라벨 없음
        Workflow (github-script)->>Workflow (github-script): 라벨 없음 로그 출력
    end
Loading

Assessment against linked issues

Objective Addressed Explanation
labeler-action 제거 (#10)
github-script 기반 PR 라벨링 적용 (#10)

Assessment against linked issues: Out-of-scope changes

해당 변경사항 내에서 이슈 요구사항과 무관한 변경은 발견되지 않았습니다.

Poem

🐇
깡총깡총 토끼가 코드를 봤지,
외부 액션은 굿바이, 스크립트로 변신!
PR 제목 따라 라벨이 척척,
자동화의 길에 한 걸음 더!
깔끔해진 워크플로우에 당근 하나 쏙!


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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
.github/workflows/PR_Label_Assign.yml (2)

22-29: Conventional Commit scope 지원 제안
현재 feat:, fix: 등 단순 prefix만 매칭하므로 feat(scope): 형식의 커밋 메시지는 라벨이 적용되지 않습니다. 다음과 같이 정규식을 확장해보세요.

- { pattern: /^feat:/i, label: '✨ feat' },
+ { pattern: /^feat(?:\([^)]*\))?:/i, label: '✨ feat' },

31-45: 기존 라벨 제거 로직 추가 권장
addLabels만 사용할 경우 PR 제목 수정 시 이전 라벨이 남아 있을 수 있습니다. addLabels 대신 setLabels를 사용해 전체 라벨을 덮어쓰도록 변경하는 것을 제안드립니다.

- if (labelsToAdd.length > 0) {
-   await github.rest.issues.addLabels({
-     issue_number: context.issue.number,
-     owner: context.repo.owner,
-     repo: context.repo.repo,
-     labels: labelsToAdd
-   });
-   core.info(`Added labels: ${labelsToAdd.join(', ')}`);
- } else {
-   core.info('No matching labels found for PR title.');
- }
+ await github.rest.issues.setLabels({
+   issue_number: context.issue.number,
+   owner: context.repo.owner,
+   repo: context.repo.repo,
+   labels: labelsToAdd
+ });
+ core.info(`Updated labels to: ${labelsToAdd.join(', ')}`);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a8502b2 and 4735671.

📒 Files selected for processing (2)
  • .github/labeler.yml (0 hunks)
  • .github/workflows/PR_Label_Assign.yml (1 hunks)
💤 Files with no reviewable changes (1)
  • .github/labeler.yml
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/PR_Label_Assign.yml

17-17: the runner of "actions/github-script@v6" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: ci-build
🔇 Additional comments (2)
.github/workflows/PR_Label_Assign.yml (2)

11-13: 최소 권한 설정으로 보안 강화
컨텐츠 읽기(contents: read)와 PR 쓰기(pull-requests: write) 권한만 부여해 권한을 최소화한 점이 좋습니다.


16-17: actions/github-script 버전
static 분석 툴에서 구 버전 경고가 떴지만 actions/github-script@v6은 현재 최신 구조에 적합합니다. 이 경고는 오탐으로 보입니다.

Copy link
Copy Markdown
Contributor

@easyhooon easyhooon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오...이러면 해결 될것같네
merge 하면 될 것 같슴다

@seoyoon513 seoyoon513 merged commit b7a21c9 into develop Jun 19, 2025
3 of 5 checks passed
@seoyoon513 seoyoon513 deleted the BOOK-51-chore/#10 branch June 19, 2025 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BOOK-51/chore] PR 라벨링 방식 github-script로 전환

2 participants