chore(repo): setup hook to notify on package lock changes (#16972)

This commit is contained in:
Craigory Coppola 2023-05-12 18:30:39 -04:00 committed by GitHub
parent 024193fb5b
commit 729a5498bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 0 deletions

3
.husky/post-checkout Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
changedFiles="$(git diff-tree -r --name-only --no-commit-id $1 $2)"
node ./scripts/notify-lockfile-changes.js $changedFiles

3
.husky/post-merge Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
changedFiles="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
node ./scripts/notify-lockfile-changes.js $changedFiles

View File

@ -0,0 +1,9 @@
if (process.argv.slice(2).some((arg) => arg.includes('pnpm-lock.yaml'))) {
console.warn(
[
'⚠️ ----------------------------------------------------------------------------------------- ⚠️',
'⚠️ pnpm-lock.yaml changed, please run `pnpm install` to ensure your packages are up to date. ⚠️',
'⚠️ ----------------------------------------------------------------------------------------- ⚠️',
].join('\n')
);
}