Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: check conventional commits #3030

Merged
merged 1 commit into from
Oct 23, 2024
Merged

ci: check conventional commits #3030

merged 1 commit into from
Oct 23, 2024

Conversation

chihiro-adachi
Copy link
Contributor

Why

Currently, all commits in the PR branch cannot be merged unless they follow Conventional Commits.
However, since we are using Squash Merge, it is sufficient if the PR title is a Conventional Commit, so the current rule is excessive.

What

Added GitHub Action to check PR Title.
see: https://github.com/amannn/action-semantic-pull-request

The following settings are required.

Setting > General > Pull Requests

  • Allow squash merging のみチェックする
  • Default commit messageをPull Request Titleに変更

Setting > Rules > Rulesets

  • Targetsをinclude default branch
  • Require status checks to passを有効にし、Validate PR Titleを追加する

How to test

2024-10-22.14.47.59.mov

Checklist

  • Read CONTRIBUTING.md
  • Updated documentation if it is required.
  • Added/updated tests if it is required. (or tested manually)
  • Passed pnpm lint and pnpm test on the root directory.

@chihiro-adachi chihiro-adachi requested a review from a team as a code owner October 23, 2024 01:59
@chihiro-adachi chihiro-adachi requested review from tasshi-me and shabaraba and removed request for a team October 23, 2024 01:59
Copy link
Member

@tasshi-me tasshi-me left a comment

Choose a reason for hiding this comment

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

LGTM!

name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
Copy link
Member

Choose a reason for hiding this comment

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

scopesオプションでscopeの制限もかけれそうだけど、一旦はconventional commitsのフォーマットに従っているかのチェックだけで良さそう。

@chihiro-adachi chihiro-adachi merged commit e77c60d into main Oct 23, 2024
17 checks passed
@chihiro-adachi chihiro-adachi deleted the ci-lint-pr-action branch October 23, 2024 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants