Skip to content

Add labels with a new GitHub Action#283

Merged
5ouma merged 1 commit intomainfrom
ci-pr-label-commit
Mar 23, 2025
Merged

Add labels with a new GitHub Action#283
5ouma merged 1 commit intomainfrom
ci-pr-label-commit

Conversation

@5ouma
Copy link
Owner

@5ouma 5ouma commented Mar 23, 2025

⚠️ Issue

close #


✏️ Description

Follow the Conventional Commit and auto-add with commits.


Follow the Conventional Commit and auto-add with commits.
Copilot AI review requested due to automatic review settings March 23, 2025 11:10
@github-actions github-actions bot added the 🎽 CI Changes to CI configuration files and scripts label Mar 23, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new GitHub Action to automatically label pull requests based on Conventional Commit messages and updates release changelog settings.

  • Adds a labeler configuration file with regex patterns for automated commit parsing.
  • Introduces a GitHub Actions workflow to trigger the labeler on pull requests.
  • Updates the release configuration to include new changelog sections and revises the PR template.

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

File Description
.github/labeler.yml Added configuration for label auto-assignment using commit regex patterns.
.github/workflows/labeler.yml Added workflow to run the labeler action on pull request events.
.github/release.yml Updated changelog configuration with new sections and exclusions.
.github/PULL_REQUEST_TEMPLATE.md Removed the "Type of the Change" checklist and Code of Conduct line.
Files not reviewed (1)
  • .github/pr-labeler.yml: Language not supported
Comments suppressed due to low confidence (2)

.github/labeler.yml:6

  • Consider updating the regex to optionally match commit messages without a scope (e.g., using '((.+))?' instead of '((.+))') if commits without a scope are valid in your workflow.
commits: '^\w+(\(.+\))?!:\s.+'

.github/release.yml:31

  • The title '⛓️ Dependency Updates' does not match the label '⛓️ Dependencies'. Consider aligning them for consistency in the changelog.
- title: ⛓️ Dependency Updates

@coderabbitai
Copy link

coderabbitai bot commented Mar 23, 2025

Walkthrough

This pull request updates several GitHub configuration files. It removes the “Type of the Change” section and its checklist from the pull request template and deletes the old PR labeler configuration. A new commit labeler configuration file is added, along with a GitHub Actions workflow for automatically adding labels to pull requests. Additionally, the changelog configuration is modified by adding an exclusion label, removing the “Security Fixes” category, introducing a “Style Updates” category, and adjusting the ordering of maintenance and build-related categories.

Changes

File(s) Change Summary
.github/PULL_REQUEST_TEMPLATE.md, .github/pr-labeler.yml Removed the “Type of the Change” section with its checklist from the pull request template and deleted the old PR labeler configuration file.
.github/labeler.yml, .github/workflows/labeler.yml Added a new commit labeler configuration file with regex matchers and introduced a GitHub Actions workflow that labels pull request events using the multi-labeler action.
.github/release.yml Updated the changelog configuration: added an exclusion label (◀️ Revert), removed the “🛡️ Security Fixes” category, introduced a “🎨 Style Updates” category, reinstated the “🏎️ Performance Improvements” entry, and adjusted the ordering by moving the “🔧 Maintenance” section and adding “🔨 Build Updates.”

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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 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

@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 (1)
.github/labeler.yml (1)

3-6: Label: Breaking Change:
The matcher regex ('^\w+(\(.+\))?!:\s.+') is designed to capture conventional commit messages that indicate breaking changes. Please verify that this pattern covers all desired variations used in your commit messages.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 736101e and 46ccf43.

📒 Files selected for processing (5)
  • .github/PULL_REQUEST_TEMPLATE.md (0 hunks)
  • .github/labeler.yml (1 hunks)
  • .github/pr-labeler.yml (0 hunks)
  • .github/release.yml (2 hunks)
  • .github/workflows/labeler.yml (1 hunks)
💤 Files with no reviewable changes (2)
  • .github/pr-labeler.yml
  • .github/PULL_REQUEST_TEMPLATE.md
🔇 Additional comments (22)
.github/workflows/labeler.yml (5)

1-2: Configuration Naming:
The workflow is aptly named "🏷️ Labeler" which immediately conveys its purpose.


3-5: Event Trigger Setup:
The workflow is configured to trigger on pull request events, aligning with the goal of labeling PRs automatically. Verify that this trigger meets all use cases for your commit and PR processes.


6-7: Global Permissions:
Specifying an empty top-level permissions: {} is a good practice to ensure a secure baseline; the required permissions are later explicitly granted at the job level.


8-12: Job Configuration:
The job named label clearly sets the required permission (pull-requests: write) and specifies the runner (Ubuntu-Latest). This focused setup is effective for your labeling action.


14-16: Action Step Implementation:
The step that uses fuxingloh/multi-labeler pinned to a specific commit (b15a54460c38f54043fa75f7b08a0e2aa5b94b5b) ensures reproducibility. Confirm that this version is well maintained and tested.

.github/labeler.yml (12)

1-2: Version Declaration:
The configuration file is versioned with v1, which is a solid starting point. Future updates should increase this version as features or regexes evolve.


7-9: Label: New Feature:
The regex ('^feat(\(.+\))?!?:\s.+') correctly targets new feature commits including optional scopes and potential breaking markers.


10-12: Label: Bug:
The pattern ('^fix(\((?!deps).+\))?!?:\s.+') smartly excludes dependency fixes by using a negative lookahead. Ensure that non-dependency bug fixes are reliably captured by this regex.


13-15: Label: Documentation:
The matcher for documentation commits ('^docs(\(.+\))?!?:\s.+') is straightforward and aligns with conventional commit standards.


16-18: Label: Style:
The regex for style changes ('^style(\(.+\))?!?:\s.+') is implemented as expected, ensuring style-related commits receive the proper label.


19-21: Label: Refactoring:
The pattern ('^refactor(\(.+\))?!?:\s.+') adequately captures refactoring commits. Confirm that this meets your team’s expectations for refactor categorization.


22-24: Label: Performance:
The regex ('^perf(\(.+\))?!?:\s.+') is on point for identifying performance improvements. Keep an eye on potential edge cases as commit formats evolve.


25-27: Label: Testing:
The matcher ('^test(\(.+\))?!?:\s.+') clearly supports the identification of testing-related changes.


28-30: Label: Build:
The regex ('^build(\(.+\))?!?:\s.+') is consistent with conventional commit practices for build changes.


31-33: Label: CI:
The CI matcher ('^ci(\(.+\))?!?:\s.+') is well designed to capture continuous integration updates without ambiguity.


34-36: Label: Maintenance:
Using a negative lookahead in the regex ('^chore(\((?!deps).+\))?!?:\s.+') helps exclude dependency-related chores. Ensure that this pattern doesn’t unintentionally filter out other valid chore commits.


37-39: Label: Revert:
The new matcher for reverts ('^revert(\(.+\))?!?:\s.+') effectively categorizes rollback commits, aiding in clear changelog generation.

.github/release.yml (5)

2-4: Changelog Exclusion Update:
Adding the "◀️ Revert" label to the changelog exclusion list is a practical decision to omit revert commits from release notes. Verify if additional commit types (if any) should be similarly excluded.


17-18: New Category - Style Updates:
The introduction of the "🎨 Style Updates" category, paired with the [🎨 Style] label, provides better granularity for style-only changes. This aligns well with your updated commit labeling strategy.


21-22: New Category - Performance Improvements:
Creating a dedicated category for "🏎️ Performance Improvements" enhances clarity in the changelog. Confirm that performance-related commits are consistently tagged across your repository.


25-26: New Category - Build Updates:
The addition of "🔨 Build Updates" is a beneficial refinement, ensuring build-related changes are distinctly recognized in the release notes.


29-30: Reordering - Maintenance:
Repositioning the "🔧 Maintenance" category can improve the logical flow of the changelog. Validate that this new ordering meets stakeholder expectations for release summaries.

@5ouma 5ouma merged commit 8bd102e into main Mar 23, 2025
6 checks passed
@5ouma 5ouma deleted the ci-pr-label-commit branch March 23, 2025 11:16
@github-actions github-actions bot mentioned this pull request Mar 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🎽 CI Changes to CI configuration files and scripts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants