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

build: Add checker for PR title #151

Merged
merged 2 commits into from
Mar 2, 2024
Merged

build: Add checker for PR title #151

merged 2 commits into from
Mar 2, 2024

Conversation

sunchao
Copy link
Member

@sunchao sunchao commented Mar 1, 2024

Which issue does this PR close?

Closes #75 .

Rationale for this change

It be useful to add a checker making sure all the PR titles conform to certain format, such as conventional commits.

What changes are included in this PR?

Added a Github action to check PR title and fail the PR if it violates the format. At the moment, the format is simply "type: message" or "type(scope): message". We don't restrict the set of valid types or scopes yet.

How are these changes tested?

@sunchao sunchao marked this pull request as ready for review March 2, 2024 01:02
run: |
if ! echo $PR_TITLE | grep -Eq '^(\w+)(\(.+\))?: .+$'; then
echo "PR title does not follow conventional commit style."
echo "Please use a title in the format: type: message, or type(scope): message"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think its misleading a bit, @sunchao
maybe we can attach a title example?

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, added an example

Copy link
Contributor

Choose a reason for hiding this comment

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

Much nicer

Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

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

lgtm thanks @sunchao

@sunchao sunchao merged commit cad16d5 into apache:main Mar 2, 2024
14 checks passed
@sunchao
Copy link
Member Author

sunchao commented Mar 2, 2024

Thanks, merged

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.

Add a Github check for PR titles
3 participants