Skip to content

Commit a9c69e5

Browse files
devversionjelbourn
authored andcommitted
build: staging script should ignore pre-commit hook (#15612)
Currently if the caretaker stages a new release, but does not have the `git-clang-format` pre-commit hook configured properly (there is some additional configuration involved), the staging script will fail. In order to avoid these failures, we just ignore the pre-commit hook when a commit is created automatically by the release scripts. The release script only makes changes which conform with the clang-format's/ the project style guidelines.
1 parent 0402d55 commit a9c69e5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/release/git/git-client.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ export class GitClient {
6161

6262
/** Creates a new commit within the current branch with the given commit message. */
6363
createNewCommit(message: string): boolean {
64-
return this._spawnGitProcess(['commit', '-m', message]).status === 0;
64+
// Disable pre-commit hooks when creating a commit. Developers might not have set up
65+
// their Git configuration for the "git-clang-format" pre-commit hook.
66+
return this._spawnGitProcess(['commit', '--no-verify', '-m', message]).status === 0;
6567
}
6668

6769
/** Gets the title of a specified commit reference. */

0 commit comments

Comments
 (0)