-
Notifications
You must be signed in to change notification settings - Fork 66
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: add error comment in lint-pr-title.yml #175
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments
.github/workflows/lint-pr-title.yml
Outdated
with: | ||
subjectPattern: ^(?![A-Z]).+$ | ||
subjectPatternError: | | ||
The subject "{subject}" found in the pull request title "{title}" should start with a lowercase character. | ||
|
||
# Comments the error message from the above lint_pr_title action and deletes the comment when the linting is correct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this comment accurate?
with: | ||
header: comment | ||
message: | | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. I would only suggest we add some additional message, from our side, with some emoji, not to have such a raw output as they provide in the action that we use.
So the error from amannn/action-semantic-pull-request
is shown as code, but before it, we should have some highlight, like maybe Hey there 👋🏼 thanks for opening the PR but we need you to adjust the title of the pull request. We require all PRs to follow Conventional Commits specification. More details 👇🏼
you know what I mean?
name: delete the comment | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
header: comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you tested it, right?
@Krishks369 hey man, need a hand? |
Hey @derberg ,do we need to refine this PR also? |
I have added feature in the lint-pr-title.yml file to comment on the lint errors in the title while PR is created
Three scenarios are there for the workflow
When the PR title is not in the correct format i.e when it is apart from titles like
feat
,fix
etc. It works like it has in this PR .When the PR title is not found or the PR subject starts in capital, then it works like in this PR
When the lint is corrected after the comment, the comment is then deleted from the PR, as mentioned in https://github.com/marocchino/sticky-pull-request-comment
Although the action used for linting the title is https://github.com/amannn/action-semantic-pull-request I have forked and used this feature before it got merged in the main action. So temporarily it uses https://github.com/Krishks369/action-semantic-pull-request.