Skip to content

Commit 3393207

Browse files
committed
Adds the no-verify flag to prevent pre-commit hooks from taking over the process
1 parent ddc2435 commit 3393207

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

__tests__/git.test.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {mkdirP, rmRF} from '@actions/io'
66
import {action, Status} from '../src/constants'
77
import {execute} from '../src/execute'
88
import {deploy, generateBranch, init, switchToBaseBranch} from '../src/git'
9-
import fs from 'fs';
9+
import fs from 'fs'
1010

1111
const originalAction = JSON.stringify(action)
1212

@@ -373,13 +373,13 @@ describe('git', () => {
373373
name: 'asd',
374374
email: 'as@cat'
375375
},
376-
clean: true,
376+
clean: true
377377
})
378378

379379
const response = await deploy(action)
380-
381-
fs.createWriteStream("assets/.nojekyll");
382-
fs.createWriteStream("assets/CNAME");
380+
381+
fs.createWriteStream('assets/.nojekyll')
382+
fs.createWriteStream('assets/CNAME')
383383

384384
// Includes the call to generateBranch
385385
expect(execute).toBeCalledTimes(12)
@@ -406,7 +406,6 @@ describe('git', () => {
406406
expect(execute).toBeCalledTimes(18)
407407
expect(rmRF).toBeCalledTimes(1)
408408
})
409-
410409

411410
it('should execute commands with clean options, ommits sha commit message', async () => {
412411
process.env.GITHUB_SHA = ''

src/git.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export async function generateBranch(action: ActionInterface): Promise<void> {
9191
)
9292
await execute(`git reset --hard`, action.workspace, action.silent)
9393
await execute(
94-
`git commit --allow-empty -m "Initial ${action.branch} commit"`,
94+
`git commit --no-verify --allow-empty -m "Initial ${action.branch} commit"`,
9595
action.workspace,
9696
action.silent
9797
)
@@ -233,7 +233,7 @@ export async function deploy(action: ActionInterface): Promise<Status> {
233233
action.silent
234234
)
235235
await execute(
236-
`git commit -m "${commitMessage}" --quiet`,
236+
`git commit -m "${commitMessage}" --quiet --no-verify`,
237237
`${action.workspace}/${temporaryDeploymentDirectory}`,
238238
action.silent
239239
)
@@ -262,7 +262,7 @@ export async function deploy(action: ActionInterface): Promise<Status> {
262262
action.silent
263263
)
264264
await execute(
265-
`git commit -m "${commitMessage}" --quiet`,
265+
`git commit -m "${commitMessage}" --quiet --no-verify`,
266266
`${action.workspace}/${temporaryDeploymentDirectory}`,
267267
action.silent
268268
)

0 commit comments

Comments
 (0)