-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use SKIP_SIMPLE_GIT_HOOKS=1 for bypassing
- Loading branch information
Showing
3 changed files
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,7 +143,7 @@ afterEach(() => { | |
projectWithUnusedConfigurationInPackageJsonPath, | ||
projectWithCustomConfigurationFilePath, | ||
].forEach((testCase) => { | ||
delete process.env.SIMPLE_GIT_HOOKS; | ||
delete process.env.SKIP_SIMPLE_GIT_HOOKS; | ||
removeGitHooksFolder(testCase); | ||
}); | ||
}); | ||
|
@@ -295,15 +295,15 @@ test.each([ | |
}) | ||
|
||
|
||
test("bypasses hooks when SIMPLE_GIT_HOOKS is set to 0", () => { | ||
test("bypasses hooks when SKIP_SIMPLE_GIT_HOOKS is set to 1", () => { | ||
execSync("git init \ | ||
&& git config user.name github-actions \ | ||
&& git config user.email [email protected]", { cwd: projectWithConfigurationInPackageJsonPath }); | ||
|
||
createGitHooksFolder(projectWithConfigurationInPackageJsonPath); | ||
|
||
spc.setHooksFromConfig(projectWithConfigurationInPackageJsonPath); | ||
process.env.SIMPLE_GIT_HOOKS = '0'; // Set environment variable | ||
process.env.SKIP_SIMPLE_GIT_HOOKS = '1'; // Set environment variable | ||
let errorOccured = false; | ||
try { | ||
execSync('git add . && git commit --allow-empty -m "Test commit" && git commit --allow-empty -am "Change commit msg"', { | ||
|