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 {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 = ''

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 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<Status> {
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<Status> {
action.silent
)
await execute(
`git commit -m "${commitMessage}" --quiet`,
`git commit -m "${commitMessage}" --quiet --no-verify`,
`${action.workspace}/${temporaryDeploymentDirectory}`,
action.silent
)