Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: commit with --no-verify (fixes #75) #76

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/update-lockfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module.exports.commitLockfiles = function commitLockfiles () {
exec(`git config user.name "${commitName}"`)

if (shouldAmend) {
exec(`git commit --amend --author="${commitName} <${commitEmail}>" --no-edit`)
exec(`git commit --no-verify --amend --author="${commitName} <${commitEmail}>" --no-edit`)
} else {
let lockfileWording
// either say "lockfile" or "lockfiles" depending on how many files are changed
Expand All @@ -71,6 +71,6 @@ module.exports.commitLockfiles = function commitLockfiles () {
lockfileWording = 'lockfile'
}
const updateMessage = `chore(package): update ${lockfileWording}\n\nhttps://npm.im/greenkeeper-lockfile`
exec(`git commit -m "${updateMessage}"`)
exec(`git commit --no-verify -m "${updateMessage}"`)
}
}
14 changes: 7 additions & 7 deletions test/__snapshots__/update.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Array [
"git config user.email \\"[email protected]\\"",
"git config user.name \\"greenkeeperio-bot\\"",
"git status --porcelain",
"git commit -m \\"chore(package): update lockfile
"git commit --no-verify -m \\"chore(package): update lockfile

https://npm.im/greenkeeper-lockfile\\"",
]
Expand Down Expand Up @@ -65,7 +65,7 @@ Array [
"git config user.email \\"[email protected]\\"",
"git config user.name \\"greenkeeperio-bot\\"",
"git status --porcelain",
"git commit -m \\"chore(package): update lockfile
"git commit --no-verify -m \\"chore(package): update lockfile

https://npm.im/greenkeeper-lockfile\\"",
]
Expand Down Expand Up @@ -98,7 +98,7 @@ Array [
"git config user.email \\"[email protected]\\"",
"git config user.name \\"greenkeeperio-bot\\"",
"git status --porcelain",
"git commit -m \\"chore(package): update lockfile
"git commit --no-verify -m \\"chore(package): update lockfile

https://npm.im/greenkeeper-lockfile\\"",
]
Expand Down Expand Up @@ -131,7 +131,7 @@ Array [
"git config user.email \\"[email protected]\\"",
"git config user.name \\"greenkeeperio-bot\\"",
"git status --porcelain",
"git commit -m \\"chore(package): update lockfile
"git commit --no-verify -m \\"chore(package): update lockfile

https://npm.im/greenkeeper-lockfile\\"",
]
Expand Down Expand Up @@ -171,7 +171,7 @@ Array [
"git config user.email \\"[email protected]\\"",
"git config user.name \\"greenkeeperio-bot\\"",
"git status --porcelain",
"git commit -m \\"chore(package): update lockfile
"git commit --no-verify -m \\"chore(package): update lockfile

https://npm.im/greenkeeper-lockfile\\"",
]
Expand Down Expand Up @@ -211,7 +211,7 @@ Array [
"git config user.email \\"[email protected]\\"",
"git config user.name \\"greenkeeperio-bot\\"",
"git status --porcelain",
"git commit -m \\"chore(package): update lockfile
"git commit --no-verify -m \\"chore(package): update lockfile

https://npm.im/greenkeeper-lockfile\\"",
]
Expand Down Expand Up @@ -239,7 +239,7 @@ Array [
"git config user.email \\"[email protected]\\"",
"git config user.name \\"greenkeeperio-bot\\"",
"git status --porcelain",
"git commit -m \\"chore(package): update lockfile
"git commit --no-verify -m \\"chore(package): update lockfile

https://npm.im/greenkeeper-lockfile\\"",
]
Expand Down
30 changes: 15 additions & 15 deletions test/lib/__snapshots__/update-lockfile.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Array [
"git config user.email \\"[email protected]\\"",
"git config user.name \\"testbot\\"",
"git status --porcelain",
"git commit -m \\"chore(package): update lockfile
"git commit --no-verify -m \\"chore(package): update lockfile

https://npm.im/greenkeeper-lockfile\\"",
]
Expand All @@ -30,7 +30,7 @@ Array [
"git config user.email \\"[email protected]\\"",
"git config user.name \\"greenkeeperio-bot\\"",
"git status --porcelain",
"git commit -m \\"chore(package): update lockfile
"git commit --no-verify -m \\"chore(package): update lockfile

https://npm.im/greenkeeper-lockfile\\"",
]
Expand All @@ -47,7 +47,7 @@ Array [
"git config user.email \\"[email protected]\\"",
"git config user.name \\"greenkeeperio-bot\\"",
"git status --porcelain",
"git commit -m \\"chore(package): update lockfile
"git commit --no-verify -m \\"chore(package): update lockfile

https://npm.im/greenkeeper-lockfile\\"",
]
Expand All @@ -63,7 +63,7 @@ Array [
"git config user.email \\"[email protected]\\"",
"git config user.name \\"greenkeeperio-bot\\"",
"git status --porcelain",
"git commit -m \\"chore(package): update lockfile
"git commit --no-verify -m \\"chore(package): update lockfile

https://npm.im/greenkeeper-lockfile\\"",
]
Expand All @@ -78,7 +78,7 @@ Array [
"git config user.email \\"[email protected]\\"",
"git config user.name \\"greenkeeperio-bot\\"",
"git status --porcelain",
"git commit -m \\"chore(package): update lockfile
"git commit --no-verify -m \\"chore(package): update lockfile

https://npm.im/greenkeeper-lockfile\\"",
]
Expand All @@ -96,7 +96,7 @@ Array [
"git config user.email \\"[email protected]\\"",
"git config user.name \\"greenkeeperio-bot\\"",
"git status --porcelain",
"git commit -m \\"chore(package): update lockfile
"git commit --no-verify -m \\"chore(package): update lockfile

https://npm.im/greenkeeper-lockfile\\"",
]
Expand All @@ -114,7 +114,7 @@ Array [
"git config user.email \\"[email protected]\\"",
"git config user.name \\"greenkeeperio-bot\\"",
"git status --porcelain",
"git commit -m \\"chore(package): update lockfile
"git commit --no-verify -m \\"chore(package): update lockfile

https://npm.im/greenkeeper-lockfile\\"",
]
Expand All @@ -132,7 +132,7 @@ Array [
"git config user.email \\"[email protected]\\"",
"git config user.name \\"greenkeeperio-bot\\"",
"git status --porcelain",
"git commit -m \\"chore(package): update lockfile
"git commit --no-verify -m \\"chore(package): update lockfile

https://npm.im/greenkeeper-lockfile\\"",
]
Expand All @@ -148,7 +148,7 @@ Array [
"git config user.email \\"[email protected]\\"",
"git config user.name \\"greenkeeperio-bot\\"",
"git status --porcelain",
"git commit -m \\"chore(package): update lockfile
"git commit --no-verify -m \\"chore(package): update lockfile

https://npm.im/greenkeeper-lockfile\\"",
]
Expand All @@ -164,7 +164,7 @@ Array [
"git config user.email \\"[email protected]\\"",
"git config user.name \\"greenkeeperio-bot\\"",
"git status --porcelain",
"git commit -m \\"chore(package): update lockfile
"git commit --no-verify -m \\"chore(package): update lockfile

https://npm.im/greenkeeper-lockfile\\"",
]
Expand All @@ -180,7 +180,7 @@ Array [
"git config user.email \\"[email protected]\\"",
"git config user.name \\"greenkeeperio-bot\\"",
"git status --porcelain",
"git commit -m \\"chore(package): update lockfile
"git commit --no-verify -m \\"chore(package): update lockfile

https://npm.im/greenkeeper-lockfile\\"",
]
Expand All @@ -195,7 +195,7 @@ Array [
"git add yarn.lock 2>/dev/null || true",
"git config user.email \\"[email protected]\\"",
"git config user.name \\"greenkeeperio-bot\\"",
"git commit --amend --author=\\"greenkeeperio-bot <[email protected]>\\" --no-edit",
"git commit --no-verify --amend --author=\\"greenkeeperio-bot <[email protected]>\\" --no-edit",
]
`;

Expand All @@ -208,7 +208,7 @@ Array [
"git add yarn.lock 2>/dev/null || true",
"git config user.email \\"[email protected]\\"",
"git config user.name \\"Example Person\\"",
"git commit --amend --author=\\"Example Person <[email protected]>\\" --no-edit",
"git commit --no-verify --amend --author=\\"Example Person <[email protected]>\\" --no-edit",
]
`;

Expand All @@ -222,7 +222,7 @@ Array [
"git config user.email \\"[email protected]\\"",
"git config user.name \\"greenkeeperio-bot\\"",
"git status --porcelain",
"git commit -m \\"chore(package): update lockfile
"git commit --no-verify -m \\"chore(package): update lockfile

https://npm.im/greenkeeper-lockfile\\"",
]
Expand All @@ -238,7 +238,7 @@ Array [
"git config user.email \\"[email protected]\\"",
"git config user.name \\"greenkeeperio-bot\\"",
"git status --porcelain",
"git commit -m \\"chore(package): update lockfile
"git commit --no-verify -m \\"chore(package): update lockfile

https://npm.im/greenkeeper-lockfile\\"",
]
Expand Down