{"action":"opened","issue":{"url":"https://api.github.com/repos/typicode/husky/issues/311","repository_url":"https://api.github.com/repos/typicode/husky","labels_url":"https://api.github.com/repos/typicode/husky/issues/311/labels{/name}","comments_url":"https://api.github.com/repos/typicode/husky/issues/311/comments","events_url":"https://api.github.com/repos/typicode/husky/issues/311/events","html_url":"https://github.com/typicode/husky/issues/311","id":337028152,"node_id":"MDU6SXNzdWUzMzcwMjgxNTI=","number":311,"title":"[QUESTION] - preparecommitmsg prepend branch name to commit message.","user":{"login":"mintuz","id":447031,"node_id":"MDQ6VXNlcjQ0NzAzMQ==","avatar_url":"https://avatars2.githubusercontent.com/u/447031?v=4","gravatar_id":"","url":"https://api.github.com/users/mintuz","html_url":"https://github.com/mintuz","followers_url":"https://api.github.com/users/mintuz/followers","following_url":"https://api.github.com/users/mintuz/following{/other_user}","gists_url":"https://api.github.com/users/mintuz/gists{/gist_id}","starred_url":"https://api.github.com/users/mintuz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mintuz/subscriptions","organizations_url":"https://api.github.com/users/mintuz/orgs","repos_url":"https://api.github.com/users/mintuz/repos","events_url":"https://api.github.com/users/mintuz/events{/privacy}","received_events_url":"https://api.github.com/users/mintuz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-29T14:49:23Z","updated_at":"2018-06-29T14:49:23Z","closed_at":null,"author_association":"NONE","body":"Hello I'm looking at using husky to prepend branch name to every commit message and I am seeing the following error `prepare-commit-msg hook failed (cannot be bypassed with --no-verify due to Git specs)` \r\n\r\nversion of Husky I am using is **0.14.3** is this something I am doing wrong or is it a bug within husky.\r\n\r\nI have this as my husky config, any help would be appreciated.\r\n\r\n```\r\n  \"husky\": {\r\n    \"hooks\": {\r\n      \"preparecommitmsg\": \"./tools/commit-message.sh\"\r\n    }\r\n  },\r\n```\r\n\r\nand the script I want to run is as follows.\r\n\r\n```\r\n#!/bin/sh\r\n#\r\n# Automatically adds branch name and branch description to every commit message.\r\n# Modified from the stackoverflow answer here: http://stackoverflow.com/a/11524807/151445\r\n#\r\n\r\n# Succeed on all merge messages, as evidenced by MERGE_MSG existing\r\n[ -f $GIT_DIR/MERGE_MSG ] && exit 0\r\n\r\n# Get branch name and description\r\nNAME=$(git branch | grep '*' | sed 's/* //')\r\n\r\n# Don't apply this logic if we are in a 'detached head' state (rebasing, read-only history, etc)\r\n# newlines below may need echo -e \"\\n\\n: (etc.)\"\r\nif [ \"$NAME\" != \"(no branch)\" ]; then\r\n\t# Append branch name and optional description to COMMIT_MSG\r\n\t# For info on parameters to githooks, run: man githooks\r\n\techo \"\\n\\n: $NAME\" >> \"$1\"\r\nfi\r\n```"}}
{"actor":{"display_login":"mintuz"}}