Skip to content

Commit 7b8f109

Browse files
frostebiteclaude
andcommitted
fix: make git hooks opt-in only — do not modify hooks when disabled
Remove the else branch that actively called GitHooksService.disableHooks() for every user where gitHooksEnabled was false (the default). This was a breaking change that silently modified core.hooksPath to point at an empty directory, disabling any existing git hooks (husky, lefthook, pre-commit, etc.). When gitHooksEnabled is false (default), the action now does nothing regarding hooks — exactly matching the behavior on main before the hooks feature was added. The hooks feature only activates when users explicitly set gitHooksEnabled: true. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f2e7568 commit 7b8f109

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

dist/index.js

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,14 @@ async function runMain() {
102102
}
103103
}
104104

105-
// Git hooks
105+
// Git hooks — opt-in only. When disabled (default), do not touch hooks at all.
106106
if (buildParameters.gitHooksEnabled) {
107107
const { GitHooksService } = await import('./model/orchestrator/services/hooks/git-hooks-service');
108108
await GitHooksService.installHooks(workspace);
109109
if (buildParameters.gitHooksSkipList) {
110110
const environment = GitHooksService.configureSkipList(buildParameters.gitHooksSkipList.split(','));
111111
Object.assign(process.env, environment);
112112
}
113-
} else {
114-
const { GitHooksService } = await import('./model/orchestrator/services/hooks/git-hooks-service');
115-
await GitHooksService.disableHooks(workspace);
116113
}
117114

118115
await PlatformSetup.setup(buildParameters, actionFolder);

0 commit comments

Comments
 (0)