From 33932070c34bbf34e8cdd8ce15ea486d05b216e5 Mon Sep 17 00:00:00 2001 From: James Ives Date: Mon, 27 Jul 2020 10:29:27 -0400 Subject: [PATCH] Adds the no-verify flag to prevent pre-commit hooks from taking over the process --- __tests__/git.test.ts | 11 +++++------ src/git.ts | 6 +++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/__tests__/git.test.ts b/__tests__/git.test.ts index 181a5b30d..0f7ed7c8f 100644 --- a/__tests__/git.test.ts +++ b/__tests__/git.test.ts @@ -6,7 +6,7 @@ import {mkdirP, rmRF} from '@actions/io' import {action, Status} from '../src/constants' import {execute} from '../src/execute' import {deploy, generateBranch, init, switchToBaseBranch} from '../src/git' -import fs from 'fs'; +import fs from 'fs' const originalAction = JSON.stringify(action) @@ -373,13 +373,13 @@ describe('git', () => { name: 'asd', email: 'as@cat' }, - clean: true, + clean: true }) const response = await deploy(action) - - fs.createWriteStream("assets/.nojekyll"); - fs.createWriteStream("assets/CNAME"); + + fs.createWriteStream('assets/.nojekyll') + fs.createWriteStream('assets/CNAME') // Includes the call to generateBranch expect(execute).toBeCalledTimes(12) @@ -406,7 +406,6 @@ describe('git', () => { expect(execute).toBeCalledTimes(18) expect(rmRF).toBeCalledTimes(1) }) - it('should execute commands with clean options, ommits sha commit message', async () => { process.env.GITHUB_SHA = '' diff --git a/src/git.ts b/src/git.ts index d0ff102b5..55ef8b97e 100644 --- a/src/git.ts +++ b/src/git.ts @@ -91,7 +91,7 @@ export async function generateBranch(action: ActionInterface): Promise { ) await execute(`git reset --hard`, action.workspace, action.silent) await execute( - `git commit --allow-empty -m "Initial ${action.branch} commit"`, + `git commit --no-verify --allow-empty -m "Initial ${action.branch} commit"`, action.workspace, action.silent ) @@ -233,7 +233,7 @@ export async function deploy(action: ActionInterface): Promise { action.silent ) await execute( - `git commit -m "${commitMessage}" --quiet`, + `git commit -m "${commitMessage}" --quiet --no-verify`, `${action.workspace}/${temporaryDeploymentDirectory}`, action.silent ) @@ -262,7 +262,7 @@ export async function deploy(action: ActionInterface): Promise { action.silent ) await execute( - `git commit -m "${commitMessage}" --quiet`, + `git commit -m "${commitMessage}" --quiet --no-verify`, `${action.workspace}/${temporaryDeploymentDirectory}`, action.silent )