-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Git pre-receive hook trigger when pushing Git notes #1446
Comments
Can you please fill out all the questions of the bug issue template? https://github.com/semantic-release/semantic-release/issues/new?template=01_bug_report.md Otherwise it's hard for us to help you |
Hi, I'm seeing similar behaviour too. Gitlab allows us to define push rules, including setting a commit message regex for the pre-receive hook. Additionally, we can enforce rejection of unsigned commits. Current behaviorUpgrading semantic release from v15 to v17 has added new notes. When these notes are committed, the commit fails our previously functioning regex validation, which follows the default angular commit convention:
Further, where commits are required to be the signed the note commit is not signed where git settings have been set to enforce gpgsign. Expected behavior
Environment
.releaserc
.gitlab-ci.yaml - publish step
Commit Validation
|
I tried to do a bit of research but couldn't find any information related to how Git notes should behave with commit hooks. I would recommend to:
|
@mckha can you clarify if the rules you configure is something specific to GitLab or if it's a regular Git hook? |
The Regex is added to the GitLab push rules, not an actual Git pre-commit hook file. I'm going to look at adding a pre-commit hook for git and test locally |
Testing with a simple
It's also worth noting that we have no notes, is it possible to via config disable note generation in the mean time? |
@pvdlg - The rules are specific to gitlab. It's an input on the UI that allows you to supply a commit regex. If using gitlab you can navigate to this on a repo through Settings > Repository > Push Rules. The 'commit message' input is described as: "All commit messages must match this regular expression to be pushed. If this field is empty it allows any commit message. For example you can require that an issue number is always mentioned in the commit message." I assume this configures a server-side pre-receive hook, but cannot confirm. The documentation relating to this can be found here. We are able to run the regex supplied above as a local githook as a work around for our own commits. However, we need this to be applied server-side to enforce consistent commits from developers, thereby creating consistent release notes. The note format I can see for semantic release is:
I've have had a look at recreating this with Github, but unfortunately the free version does not offer the same functionality as Gitlab. |
If the local hook works but the remote one doesn't I guess it's either because GitLab is doing something on top of the hook or maybe it's related to the version of Git they are using. |
Raised a GitLab issue, I'm going to try getting a test project setup for this as well. |
As a temporary workaround you may add the following sequence to your regex pattern
So it will match the refs convention
Looking forwards for a fix from GitLab team |
Thanks for the work around, will test it locally |
I met same issue at self-hosted git server with want to know if any options to skip |
I also have this issue, it would be really helpful if we could at least configure the commit message. We have a hook to check for jira tickets in the commits and it is failing too
|
Gitlab issue: https://gitlab.com/gitlab-org/gitlab/-/issues/207807 |
@pvdlg What about the GPG part of the issue described in #1446 (comment)? Semantic-release can be configured to sign commits and tags, is the same possible for notes? |
When we upgraded to v16 we started getting the following error in GitLab:
It looks like the new notes part is committing with a format that doesn't follow the commit format, but I can't see what the commit message is in the logs.
Have I missed a prefix or is something else wrong?
The text was updated successfully, but these errors were encountered: