-
Notifications
You must be signed in to change notification settings - Fork 21
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
[skip] Add commit length check workflow #79
Conversation
.github/workflows/main.yml
Outdated
- name: Check Line Length | ||
uses: gsactions/commit-message-checker@v2 | ||
with: | ||
pattern: '^[^#].{1,65}' |
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 pattern correct? Doesn't it prohibit a #
at any of the first 65 characters (which would match something containing (bsc#1234)
?
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.
It does not :) (see this PR). Do you want me to add a long commit that breaks the rule? In either case, we should be able to simplify this to ^.{1,65}
I believe, right?
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.
Modified the regex - now:
- A commit over 65 chars will fail, unless it starts with [skip]
- Any commit that starts with [skip] will pass
7f915e2
to
45c7855
Compare
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.
LGTM, Thanks!
As discussed in Slack, maybe we should fix https://github.com/openSUSE/obs-service-update_changelog, so multiline commits are not producing too many dashes.
Agreed @meaksh , I've added it to our backlog: https://github.com/orgs/SUSE/projects/29/views/4?pane=issue&itemId=55548658 Merging this PR in the meantime. |
This PR enforces that each commit is <67 characters long, where the first 2 characters are
-
in the changelog.If your commit is too long, you can execute
git rebase -i HEAD~1
(for the last commit) - changepick
toreword
, rewrite the commit message, and force push the changes to your branch.