Skip to content

Commit

Permalink
Adds the no-verify flag to prevent pre-commit hooks from taking over …
Browse files Browse the repository at this point in the history
…the process
  • Loading branch information
JamesIves committed Jul 27, 2020
1 parent ddc2435 commit 3393207
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
11 changes: 5 additions & 6 deletions __tests__/git.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand All @@ -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 = ''
Expand Down
6 changes: 3 additions & 3 deletions src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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
)
Expand Down Expand Up @@ -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
)
Expand Down

0 comments on commit 3393207

Please sign in to comment.