chore(repo): setup hook to notify on package lock changes (#16972)
This commit is contained in:
parent
024193fb5b
commit
729a5498bc
3
.husky/post-checkout
Executable file
3
.husky/post-checkout
Executable 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
3
.husky/post-merge
Executable 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
|
||||
9
scripts/notify-lockfile-changes.js
Normal file
9
scripts/notify-lockfile-changes.js
Normal 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')
|
||||
);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user