Skip to content

Commit

Permalink
fix ci git init issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bhanufyi committed Sep 5, 2023
1 parent 79136a8 commit 3d0ff4c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions simple-git-hooks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,9 @@ afterEach(() => {
})

test("bypasses hooks when SIMPLE_GIT_HOOKS is set to 0", () => {
execSync("git init", { cwd: projectWithConfigurationInPackageJsonPath });
execSync("git init \
&& git config user.name github-actions \
&& git config user.email [email protected]", { cwd: projectWithConfigurationInPackageJsonPath });

createGitHooksFolder(projectWithConfigurationInPackageJsonPath);

Expand All @@ -408,6 +410,9 @@ test("bypasses hooks when SIMPLE_GIT_HOOKS is set to 0", () => {
env: { ...process.env },
});
} catch (e) {
console.log(e)
console.log(e.stdout.toString())
console.log(e.stderr.toString())
errorOccured = true;
}

Expand All @@ -416,7 +421,12 @@ test("bypasses hooks when SIMPLE_GIT_HOOKS is set to 0", () => {


test("hook executes when bypass var is not set", () => {
execSync("git init", { cwd: projectWithConfigurationInPackageJsonPath });
execSync(
"git init \
&& git config user.name github-actions \
&& git config user.email [email protected]",
{ cwd: projectWithConfigurationInPackageJsonPath }
);

createGitHooksFolder(projectWithConfigurationInPackageJsonPath);

Expand Down

0 comments on commit 3d0ff4c

Please sign in to comment.