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

feat: Lint PR Title #4146

Closed
4 tasks
mircea-pavel-anton opened this issue Sep 11, 2024 · 2 comments
Closed
4 tasks

feat: Lint PR Title #4146

mircea-pavel-anton opened this issue Sep 11, 2024 · 2 comments
Labels

Comments

@mircea-pavel-anton
Copy link

Expected Behavior

Generally, when I merge a PR back into main, I also squash the commit to keep the git history clean. Thus, running commitlint on the individual commits in the PR makes little sense. I would like to be able to also run commitlint on the PR title and just have it fail if it is not ok

Current Behavior

Currently, it seems we can only lint all the commits inside a PR

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

No response

Context

No response

@pat-s
Copy link

pat-s commented Oct 3, 2024

You can echo the env var that holds the PR title and pipe it into commitlint:

echo "${{ github.event.pull_request.title }}" | commitlint

@mircea-pavel-anton
Copy link
Author

mircea-pavel-anton commented Oct 3, 2024

@pat-s thank you for the reply!

That's precisely what I ended up doing. I forgot to comment back and close this
😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants