ci: GitHub action for conventional commits #2

Merged
matous-volf merged 2 commits from ci/conventional-commits-check into main 2024-08-15 09:55:34 +00:00
matous-volf commented 2024-08-15 09:39:39 +00:00 (Migrated from github.com)

Summary by CodeRabbit

  • New Features

    • Introduced a GitHub Actions workflow to enforce conventional commit messages for pull requests, enhancing clarity and consistency in version control.
  • Improvements

    • Automates validation of commit messages upon pull request creation, streamlining the development process and promoting best practices.
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a GitHub Actions workflow to enforce conventional commit messages for pull requests, enhancing clarity and consistency in version control. - **Improvements** - Automates validation of commit messages upon pull request creation, streamlining the development process and promoting best practices. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
coderabbitai[bot] commented 2024-08-15 09:39:46 +00:00 (Migrated from github.com)

Walkthrough

The introduced change implements a new GitHub Actions workflow to enforce conventional commit message standards for pull requests directed at the main branch. This automated process ensures that all proposed changes comply with a defined message format, thus enhancing clarity and consistency in commit practices. The workflow checks out the repository code and validates commit messages using a specified action, promoting best practices in version control.

Changes

File Path Change Summary
.github/workflows/conventional-commits.yml Added a new workflow to validate conventional commit messages for pull requests targeting the main branch. Includes job setup, checkout action, and validation step.

Sequence Diagram(s)

sequenceDiagram
    participant PR as Pull Request
    participant GH as GitHub Actions
    participant Repo as Repository
    participant Validator as Commit Validator

    PR->>GH: Create Pull Request
    GH->>Repo: Checkout Code
    GH->>Validator: Validate Commit Messages
    Validator-->>GH: Validation Result
    GH-->>PR: Notify Result

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.
<!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- walkthrough_start --> ## Walkthrough The introduced change implements a new GitHub Actions workflow to enforce conventional commit message standards for pull requests directed at the `main` branch. This automated process ensures that all proposed changes comply with a defined message format, thus enhancing clarity and consistency in commit practices. The workflow checks out the repository code and validates commit messages using a specified action, promoting best practices in version control. ## Changes | File Path | Change Summary | |----------------------------------------|--------------------------------------------------------------------------------------------------------| | `.github/workflows/conventional-commits.yml` | Added a new workflow to validate conventional commit messages for pull requests targeting the `main` branch. Includes job setup, checkout action, and validation step. | ## Sequence Diagram(s) ```mermaid sequenceDiagram participant PR as Pull Request participant GH as GitHub Actions participant Repo as Repository participant Validator as Commit Validator PR->>GH: Create Pull Request GH->>Repo: Checkout Code GH->>Validator: Validate Commit Messages Validator-->>GH: Validation Result GH-->>PR: Notify Result ``` <!-- walkthrough_end --><!-- This is an auto-generated comment: raw summary by coderabbit.ai --> <!-- # Existing changesets .github/workflows/conventional-commits.yml: ## AI-generated summary of changes The newly introduced YAML configuration file, `.github/workflows/conventional-commits.yml`, establishes a GitHub Actions workflow dedicated to enforcing conventional commit messages for pull requests targeting the `master` branch. This workflow is triggered automatically on pull request events, ensuring that every proposed change adheres to a standardized commit message format, which enhances clarity and consistency in version control practices. The workflow consists of a single job named `build`, which runs on an Ubuntu 22.04 environment. Within this job, a series of steps are defined to facilitate the process. The initial step utilizes the `actions/checkout@v3` action, which checks out the repository's code, making it accessible for subsequent actions. Following this, the workflow employs the `webiny/action-conventional-commits@v1.3.0` action, which is responsible for validating the commit messages. This action utilizes the `GITHUB_TOKEN` secret to authenticate and authorize the workflow's operations, ensuring that it can interact with the GitHub API securely. The overall control flow of this configuration is straightforward: upon the creation of a pull request, the workflow is triggered, the repository is checked out, and the commit messages are validated against the conventional commit standards. This process not only streamlines the development workflow but also promotes best practices in commit message formatting, which can improve collaboration and maintainability of the codebase. ## Alterations to the declarations of exported or public entities - `name: conventional commits` in `.github/workflows/conventional-commits.yml` → `name: conventional commits` in `.github/workflows/conventional-commits.yml` - `on:` in `.github/workflows/conventional-commits.yml` → `on:` in `.github/workflows/conventional-commits.yml` - `jobs:` in `.github/workflows/conventional-commits.yml` → `jobs:` in `.github/workflows/conventional-commits.yml` - `build:` in `.github/workflows/conventional-commits.yml` → `build:` in `.github/workflows/conventional-commits.yml` - `steps:` in `.github/workflows/conventional-commits.yml` → `steps:` in `.github/workflows/conventional-commits.yml` - `uses: actions/checkout@v3` in `.github/workflows/conventional-commits.yml` → `uses: actions/checkout@v3` in `.github/workflows/conventional-commits.yml` - `uses: webiny/action-conventional-commits@v1.3.0` in `.github/workflows/conventional-commits.yml` → `uses: webiny/action-conventional-commits@v1.3.0` in `.github/workflows/conventional-commits.yml` - `with:` in `.github/workflows/conventional-commits.yml` → `with:` in `.github/workflows/conventional-commits.yml` - `GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}` in `.github/workflows/conventional-commits.yml` → `GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}` in `.github/workflows/conventional-commits.yml` # New changesets .github/workflows/conventional-commits.yml: ## AI-generated summary of changes The newly added YAML configuration file, `.github/workflows/conventional-commits.yml`, establishes a GitHub Actions workflow aimed at enforcing conventional commit message standards for pull requests directed at the `main` branch. This workflow is automatically triggered by pull request events, ensuring that all proposed changes conform to a predefined commit message format, thereby enhancing clarity and consistency in version control practices. The workflow is structured around a single job named `build`, which operates within an Ubuntu 22.04 environment. Within this job, a series of steps are defined to facilitate the process. The first step employs the `actions/checkout@v3` action to check out the repository's code, making it available for subsequent actions. The next step utilizes the `webiny/action-conventional-commits@v1.3.0` action, which validates the commit messages against the conventional commit standards. This action uses the `GITHUB_TOKEN` secret for authentication, enabling secure interaction with the GitHub API. The control flow of this configuration is straightforward: upon the creation of a pull request, the workflow is triggered, the repository is checked out, and the commit messages are validated. This process not only streamlines the development workflow but also promotes best practices in commit message formatting, ultimately improving collaboration and maintainability within the codebase. ## Alterations to the declarations of exported or public entities - `name: conventional commits` in `.github/workflows/conventional-commits.yml` → `name: conventional commits` in `.github/workflows/conventional-commits.yml` - `on:` in `.github/workflows/conventional-commits.yml` → `on:` in `.github/workflows/conventional-commits.yml` - `jobs:` in `.github/workflows/conventional-commits.yml` → `jobs:` in `.github/workflows/conventional-commits.yml` - `build:` in `.github/workflows/conventional-commits.yml` → `build:` in `.github/workflows/conventional-commits.yml` - `steps:` in `.github/workflows/conventional-commits.yml` → `steps:` in `.github/workflows/conventional-commits.yml` - `uses: actions/checkout@v3` in `.github/workflows/conventional-commits.yml` → `uses: actions/checkout@v3` in `.github/workflows/conventional-commits.yml` - `uses: webiny/action-conventional-commits@v1.3.0` in `.github/workflows/conventional-commits.yml` → `uses: webiny/action-conventional-commits@v1.3.0` in `.github/workflows/conventional-commits.yml` - `with:` in `.github/workflows/conventional-commits.yml` → `with:` in `.github/workflows/conventional-commits.yml` - `GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}` in `.github/workflows/conventional-commits.yml` → `GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}` in `.github/workflows/conventional-commits.yml` --> <!-- end of auto-generated comment: raw summary by coderabbit.ai --><!-- This is an auto-generated comment: pr objectives by coderabbit.ai --> <!-- ## PR summary The pull request titled "ci: conventional commits GitHub action" was submitted by the user matous-volf. It introduces a GitHub Action designed to enforce conventional commit standards within the project's continuous integration (CI) workflow. The action aims to ensure that commit messages adhere to a specified format, which can help in maintaining a consistent commit history and improving the automation of versioning and changelog generation. No additional description or details were provided in the pull request, so the focus remains solely on the implementation of the conventional commits GitHub action as part of the CI process. --- Title: ci: conventional commits GitHub action Number: 2 User: matous-volf --> <!-- end of auto-generated comment: pr objectives by coderabbit.ai --><!-- commit_ids_reviewed_start --> <!-- d712450c6f801581a7b6acd4dc30da13d278fbab --> <!-- afd22c3d9625afc28e3046cc139953e14b81674e --> <!-- commit_ids_reviewed_end --><!-- tips_start --> --- <details> <summary>Tips</summary> ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit <commit_id>.` - `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 generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@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 as 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 resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### 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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements. </details> <!-- tips_end -->
coderabbitai[bot] (Migrated from github.com) reviewed 2024-08-15 09:40:48 +00:00
coderabbitai[bot] (Migrated from github.com) left a comment

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between a8543ba08c and d712450c6f.

Files selected for processing (1)
  • .github/workflows/conventional-commits.yml (1 hunks)
Additional comments not posted (3)
.github/workflows/conventional-commits.yml (3)

3-5: Trigger setup is correct.

The workflow is correctly configured to trigger on pull requests targeting the master branch.


7-10: Job configuration is appropriate.

The job is correctly set to run on ubuntu-22.04, which is a stable and supported version.


11-15: Steps are correctly configured.

The workflow uses actions/checkout@v3 and webiny/action-conventional-commits@v1.3.0 appropriately. The GITHUB_TOKEN is correctly provided for authentication.

**Actionable comments posted: 0** <details> <summary>Review details</summary> **Configuration used: CodeRabbit UI** **Review profile: ASSERTIVE** <details> <summary>Commits</summary> Files that changed from the base of the PR and between a8543ba08c9ea8fbe1553065a9ac246875b486ad and d712450c6f801581a7b6acd4dc30da13d278fbab. </details> <details> <summary>Files selected for processing (1)</summary> * .github/workflows/conventional-commits.yml (1 hunks) </details> <details> <summary>Additional comments not posted (3)</summary><blockquote> <details> <summary>.github/workflows/conventional-commits.yml (3)</summary><blockquote> `3-5`: **Trigger setup is correct.** The workflow is correctly configured to trigger on pull requests targeting the `master` branch. --- `7-10`: **Job configuration is appropriate.** The job is correctly set to run on `ubuntu-22.04`, which is a stable and supported version. --- `11-15`: **Steps are correctly configured.** The workflow uses `actions/checkout@v3` and `webiny/action-conventional-commits@v1.3.0` appropriately. The `GITHUB_TOKEN` is correctly provided for authentication. </blockquote></details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
coderabbitai[bot] (Migrated from github.com) reviewed 2024-08-15 09:40:51 +00:00
coderabbitai[bot] (Migrated from github.com) reviewed 2024-08-15 09:49:08 +00:00
coderabbitai[bot] (Migrated from github.com) left a comment

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between d712450c6f and afd22c3d96.

Files selected for processing (1)
  • .github/workflows/conventional-commits.yml (1 hunks)
Additional comments not posted (2)
.github/workflows/conventional-commits.yml (2)

1-5: Correctly configured workflow trigger.

The workflow is correctly set to trigger on pull requests targeting the main branch. This aligns with the goal of enforcing commit standards on incoming changes.


7-15: Ensure the GitHub token is correctly set up.

The workflow uses webiny/action-conventional-commits@v1.3.0, which requires a GitHub token. Ensure that the GITHUB_TOKEN secret is correctly configured in the repository settings to allow the action to authenticate and perform its checks.

**Actionable comments posted: 0** <details> <summary>Review details</summary> **Configuration used: CodeRabbit UI** **Review profile: ASSERTIVE** <details> <summary>Commits</summary> Files that changed from the base of the PR and between d712450c6f801581a7b6acd4dc30da13d278fbab and afd22c3d9625afc28e3046cc139953e14b81674e. </details> <details> <summary>Files selected for processing (1)</summary> * .github/workflows/conventional-commits.yml (1 hunks) </details> <details> <summary>Additional comments not posted (2)</summary><blockquote> <details> <summary>.github/workflows/conventional-commits.yml (2)</summary><blockquote> `1-5`: **Correctly configured workflow trigger.** The workflow is correctly set to trigger on pull requests targeting the `main` branch. This aligns with the goal of enforcing commit standards on incoming changes. --- `7-15`: **Ensure the GitHub token is correctly set up.** The workflow uses `webiny/action-conventional-commits@v1.3.0`, which requires a GitHub token. Ensure that the `GITHUB_TOKEN` secret is correctly configured in the repository settings to allow the action to authenticate and perform its checks. </blockquote></details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
coderabbitai[bot] (Migrated from github.com) approved these changes 2024-08-15 09:49:11 +00:00
Sign in to join this conversation.
No Milestone
No project
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: matous-volf/todo-baggins#2
No description provided.