@windyroad/risk-scorer 0.19.13 → 0.19.14-preview.1290
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/hooks/git-push-gate.sh
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
# PreToolUse hook for pipeline discipline:
|
|
3
|
-
# - Blocks bare `git push
|
|
3
|
+
# - Blocks bare/protected-branch `git push`; gives main and feature-branch paths.
|
|
4
4
|
# - Gates `npm run push:watch` and `npm run merge:watch` on push risk score
|
|
5
5
|
# (TTL + drift + threshold), while letting those watchers wait on pending CI.
|
|
6
6
|
# - Gates `npx changeset` / `npm run changeset` on release + push risk (back-pressure).
|
|
@@ -43,7 +43,7 @@ if echo "$COMMAND" | grep -qE '(^|;|&&|\|\|)\s*git push(\s|$)'; then
|
|
|
43
43
|
! echo "$COMMAND" | grep -qE 'git push\s+\S+\s+(master|main|publish|changeset-release/)'; then
|
|
44
44
|
exit 0
|
|
45
45
|
fi
|
|
46
|
-
risk_gate_deny "
|
|
46
|
+
risk_gate_deny "For main, run \`npm run push:watch\`. For a feature branch, run \`git push origin <branch>\`, open its PR, then \`gh pr checks <PR> --watch\`. Direct pushes to main, publish, and changeset-release/* are blocked."
|
|
47
47
|
exit 0
|
|
48
48
|
fi
|
|
49
49
|
|
package/package.json
CHANGED