Skip to content

fix(ng-dev/release): prepare-commit-message hook accidentally running when bump commit is created #247

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

Merged

Conversation

devversion
Copy link
Member

The prepare-commit-message hook can still accidentally run when the
changelog / version bump commit is created. This is problematic because
when a version branch is checked out (like the patch branch), the node
modules are not necessarily updated/re-installed, and the node modules
from master remain installed. This can cause runtime errors when Git
hooks accidentally run with a tool from the node modules (like ng-dev
itself).

We fix this by also setting the HUSKY environment variable, similar to
how the merge tool does. We can assume that Husky is used in all
repositories. This should be our standard for hooks.

… when bump commit is created

The `prepare-commit-message` hook can still accidentally run when the
changelog / version bump commit is created. This is problematic because
when a version branch is checked out (like the patch branch), the node
modules are not necessarily updated/re-installed, and the node modules
from master remain installed. This can cause runtime errors when Git
hooks accidentally run with a tool from the node modules (like `ng-dev`
itself).

We fix this by also setting the `HUSKY` environment variable, similar to
how the merge tool does. We can assume that Husky is used in all
repositories. This should be our standard for hooks.
@google-cla google-cla bot added the cla: yes label Oct 1, 2021
@devversion devversion added the action: merge The PR is ready for merge by the caretaker label Oct 1, 2021
Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@devversion devversion merged commit e638278 into angular:main Oct 1, 2021
dgp1130 added a commit to dgp1130/angular-cli that referenced this pull request Oct 1, 2021
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants