Skip to content

Commit e38174e

Browse files
improving the hook and removing duplicate references (#10)
GitOrigin-RevId: 995fd1a609361abf7573659ecb1d544d5e710f0c
1 parent 8d5e04a commit e38174e

2 files changed

Lines changed: 41 additions & 6 deletions

File tree

.claude-plugin/plugin.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "render",
33
"description": "Deploy, debug, and monitor applications on Render cloud platform with intelligent Blueprint generation and error diagnosis",
44
"version": "1.0.0",
5-
"hooks": "./hooks/hooks.json",
65
"author": {
76
"name": "Render",
87
"url": "https://render.com"

hooks/auto-approve-render.sh

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,55 @@ esac
2222

2323
# Check for destructive keywords first - never auto-approve these
2424
case "$command" in
25-
*delete*|*restart*|*create*|*deploy*|*update*|*set*|*suspend*|*resume*|*scale*)
25+
*delete*|*remove*|*restart*|*create*|*deploy*|*update*|*set*|*suspend*|*resume*|*scale*|*stop*|*start*|*rollback*|*promote*|*cancel*)
2626
exit 0
2727
;;
2828
esac
2929

3030
# Whitelist of safe, read-only operations that should be auto-approved
31-
case "$command" in
32-
"render services list"*|"render services -o json"*|"render services --output json"*)
31+
# Uses word boundaries where possible to avoid false matches
32+
33+
# Extract the subcommand (second word) for easier matching
34+
subcommand=$(echo "$command" | awk '{print $2}')
35+
action=$(echo "$command" | awk '{print $3}')
36+
37+
case "$subcommand" in
38+
# Info commands - always safe
39+
version|help|--help|-h|--version|-v|whoami|regions)
3340
;;
34-
"render logs -r"*|"render logs --raw"*)
41+
42+
# Resource listing and viewing
43+
services|deploys|postgres|redis|keyval|jobs|cron|blueprints|env|domains|headers|routes|disks)
44+
case "$action" in
45+
list|show|get|info|tail|""|--*)
46+
# Empty action or flags after resource = likely a list/show operation
47+
;;
48+
*)
49+
exit 0
50+
;;
51+
esac
3552
;;
36-
"render workspace current"*|"render workspace list"*|"render workspace -o json"*|"render workspace --output json"*)
53+
54+
# Logs - viewing is safe
55+
logs)
3756
;;
57+
58+
# Workspace operations - list/show/current are safe
59+
workspace)
60+
case "$action" in
61+
list|current|show|get|""|--*)
62+
;;
63+
*)
64+
exit 0
65+
;;
66+
esac
67+
;;
68+
69+
# SSH/shell access - requires explicit permission
70+
ssh|shell|exec)
71+
exit 0
72+
;;
73+
3874
*)
3975
exit 0
4076
;;

0 commit comments

Comments
 (0)