Adds the no-verify flag to prevent pre-commit hooks from taking over the process

This commit is contained in:
James Ives 2020-07-27 10:29:27 -04:00
parent ddc2435e6b
commit 33932070c3
2 changed files with 8 additions and 9 deletions

View File

@ -6,7 +6,7 @@ import {mkdirP, rmRF} from '@actions/io'
import {action, Status} from '../src/constants' import {action, Status} from '../src/constants'
import {execute} from '../src/execute' import {execute} from '../src/execute'
import {deploy, generateBranch, init, switchToBaseBranch} from '../src/git' import {deploy, generateBranch, init, switchToBaseBranch} from '../src/git'
import fs from 'fs'; import fs from 'fs'
const originalAction = JSON.stringify(action) const originalAction = JSON.stringify(action)
@ -373,13 +373,13 @@ describe('git', () => {
name: 'asd', name: 'asd',
email: 'as@cat' email: 'as@cat'
}, },
clean: true, clean: true
}) })
const response = await deploy(action) const response = await deploy(action)
fs.createWriteStream("assets/.nojekyll"); fs.createWriteStream('assets/.nojekyll')
fs.createWriteStream("assets/CNAME"); fs.createWriteStream('assets/CNAME')
// Includes the call to generateBranch // Includes the call to generateBranch
expect(execute).toBeCalledTimes(12) expect(execute).toBeCalledTimes(12)
@ -407,7 +407,6 @@ describe('git', () => {
expect(rmRF).toBeCalledTimes(1) expect(rmRF).toBeCalledTimes(1)
}) })
it('should execute commands with clean options, ommits sha commit message', async () => { it('should execute commands with clean options, ommits sha commit message', async () => {
process.env.GITHUB_SHA = '' process.env.GITHUB_SHA = ''
Object.assign(action, { Object.assign(action, {

View File

@ -91,7 +91,7 @@ export async function generateBranch(action: ActionInterface): Promise<void> {
) )
await execute(`git reset --hard`, action.workspace, action.silent) await execute(`git reset --hard`, action.workspace, action.silent)
await execute( 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.workspace,
action.silent action.silent
) )
@ -233,7 +233,7 @@ export async function deploy(action: ActionInterface): Promise<Status> {
action.silent action.silent
) )
await execute( await execute(
`git commit -m "${commitMessage}" --quiet`, `git commit -m "${commitMessage}" --quiet --no-verify`,
`${action.workspace}/${temporaryDeploymentDirectory}`, `${action.workspace}/${temporaryDeploymentDirectory}`,
action.silent action.silent
) )
@ -262,7 +262,7 @@ export async function deploy(action: ActionInterface): Promise<Status> {
action.silent action.silent
) )
await execute( await execute(
`git commit -m "${commitMessage}" --quiet`, `git commit -m "${commitMessage}" --quiet --no-verify`,
`${action.workspace}/${temporaryDeploymentDirectory}`, `${action.workspace}/${temporaryDeploymentDirectory}`,
action.silent action.silent
) )