-
-
Notifications
You must be signed in to change notification settings - Fork 88
InjectIssueKeyFromBranch does not work as expected #230
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
Comments
I will have a look and see if I can reproduce the issue. |
Ok I found the issue. The action checks if the issue key is already in the prepared commit messages and if so it does nothing. In the new version I'll release in a bit (still thinking about some edge cases) this should be fixed. |
The action will now re-add the previous defined comment lines as well. An issue key present in a comment part of the message will no longer prevent the addition of the found issue key. issue: #230
Fixed and released with version 5.18.3 Thanks for reporting it :) |
Thank you for the quick fix |
I have looked it up again, either the error is now from my side or there are still issues. For debug: i did this in the
and output was again correct but somehow again githu did not recognize |
Are you committing via an external tool like PHPStorm or Kraken, or on the terminal? |
How it should work.
If you use PHPStorm or the |
I tested it via git commit now (without -m) and got exactly the same results as i have done with -m.
|
It works on my machine :/ "prepare-commit-msg": {
"enabled": true,
"actions": [
{
"action": "\\CaptainHook\\App\\Hook\\Message\\Action\\InjectIssueKeyFromBranch",
"options": {
"regex": "#([A-Z]+\\-[0-9]+)#i",
"into": "body",
"mode": "append",
"prefix": "\nissue: ",
"force": false
}
}
]
} I'm on branch
Then my git log looks like this
How do you execute the |
I found the issue, it was actually my fault, i have put it under "commit-msg" instead of "prepare-commit-msg". Somehow the application did not throw any errors + even recognized it as a valid action under "commit-msg" and even composed the correct message :D |
Hello
today i tried to implement the action
\\CaptainHook\\App\\Hook\\Message\\Action\\InjectIssueKeyFromBranch
via ourcaptainhook.json
file.The config looks like this:
After i run
vendor/bin/captainhook install -f
i commited something to test this feature out. Sadly the commit message has not changed.After thinking a little bit whether what might have caused this, i just went into the files and added an echo in
\\CaptainHook\\App\\Hook\\Message\\Action\\InjectIssueKeyFromBranch
at line101
withecho $newMsgData['subject'] . PHP_EOL . PHP_EOL . $newMsgData['body'];
. The output was correct and the application was able to extract the issuekey.I dont know why git does not recognize this change or whether there is a bug
The text was updated successfully, but these errors were encountered: