commands.json.example 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. {
  2. "$schema": "https://json-schema.org/draft-07/schema#",
  3. "description": "Command configuration for webhook events. Available variables: {{repo}}, {{full_repo}}, {{repo_owner}}, {{branch}}, {{pusher}}, {{event}}, {{commit}}, {{commit_msg}}, {{pr_number}}, {{pr_action}}, {{tag}}, {{ref_type}}, {{issue_number}}, {{issue_title}}, {{issue_action}}, {{issue_body}}, {{issue_assignee}}, {{comment_body}}",
  4. "commands": {
  5. "push": [
  6. {
  7. "name": "echo-push-event",
  8. "description": "Simple echo command for push events",
  9. "type": "shell",
  10. "command": "echo",
  11. "args": ["Push to {{branch}} by {{pusher}} in {{repo}}"],
  12. "cwd": null,
  13. "timeout": 300000,
  14. "filterBranch": null
  15. },
  16. {
  17. "name": "deploy-production",
  18. "description": "Deploy to production on main branch",
  19. "type": "shell",
  20. "command": "/path/to/deploy.sh",
  21. "args": ["{{branch}}", "{{repo}}", "{{pusher}}"],
  22. "cwd": "/workspace",
  23. "timeout": 600000,
  24. "filterBranch": "main"
  25. }
  26. ],
  27. "pull_request": [
  28. {
  29. "name": "pr-notification",
  30. "description": "Notify team about pull requests",
  31. "type": "shell",
  32. "command": "echo",
  33. "args": ["PR #{{pr_number}} {{pr_action}} by {{pusher}}"],
  34. "cwd": null,
  35. "timeout": 300000,
  36. "filterBranch": null
  37. }
  38. ],
  39. "create": [
  40. {
  41. "name": "branch-created",
  42. "description": "Handle new branch or tag creation",
  43. "type": "shell",
  44. "command": "echo",
  45. "args": ["Created {{ref_type}} {{branch}} in {{repo}}"],
  46. "cwd": null,
  47. "timeout": 300000,
  48. "filterBranch": null
  49. }
  50. ],
  51. "delete": [
  52. {
  53. "name": "branch-deleted",
  54. "description": "Handle branch or tag deletion",
  55. "type": "shell",
  56. "command": "echo",
  57. "args": ["Deleted {{ref_type}} {{branch}} from {{repo}}"],
  58. "cwd": null,
  59. "timeout": 300000,
  60. "filterBranch": null
  61. }
  62. ],
  63. "release": [
  64. {
  65. "name": "release-notification",
  66. "description": "Handle release events",
  67. "type": "shell",
  68. "command": "echo",
  69. "args": ["Release {{tag}} {{pr_action}} in {{repo}}"],
  70. "cwd": null,
  71. "timeout": 300000,
  72. "filterBranch": null
  73. }
  74. ],
  75. "issues": [
  76. {
  77. "name": "issue-notification",
  78. "description": "Notify team about issues",
  79. "type": "shell",
  80. "command": "echo",
  81. "args": ["Issue #{{issue_number}} {{issue_action}} by {{pusher}} in {{repo}}: {{issue_title}}"],
  82. "cwd": null,
  83. "timeout": 300000,
  84. "filterBranch": null
  85. },
  86. {
  87. "name": "claude-issue-handler",
  88. "description": "Automatically handle issues assigned to Claude with Claude Agent SDK TypeScript client",
  89. "type": "shell",
  90. "command": "/data/agent-manager/scripts/handle-issue-ts.sh",
  91. "args": ["{{repo_owner}}", "{{repo}}", "{{pusher}}", "{{issue_number}}", "{{issue_title}}", "{{issue_body}}", "{{issue_action}}", "", "{{issue_assignee}}"],
  92. "cwd": "~",
  93. "timeout": 600000,
  94. "filterBranch": null
  95. },
  96. {
  97. "name": "triage-issue",
  98. "description": "Auto-triage issues with a script",
  99. "type": "shell",
  100. "command": "/path/to/triage-issue.sh",
  101. "args": ["{{repo}}", "{{issue_number}}", "{{issue_body}}"],
  102. "cwd": null,
  103. "timeout": 300000,
  104. "filterBranch": null
  105. },
  106. {
  107. "name": "process-issue-with-node",
  108. "description": "Process issue with Node.js script",
  109. "type": "node",
  110. "command": "./scripts/process-issue.js",
  111. "args": ["--repo", "{{repo}}", "--issue", "{{issue_number}}", "--action", "{{issue_action}}"],
  112. "cwd": null,
  113. "timeout": 300000,
  114. "filterBranch": null
  115. }
  116. ],
  117. "issue_comment": [
  118. {
  119. "name": "comment-notification",
  120. "description": "Handle issue comments",
  121. "type": "shell",
  122. "command": "echo",
  123. "args": ["Comment on issue #{{issue_number}} by {{pusher}}: {{comment_body}}"],
  124. "cwd": null,
  125. "timeout": 300000,
  126. "filterBranch": null
  127. },
  128. {
  129. "name": "claude-comment-handler",
  130. "description": "Automatically handle issue comments for issues assigned to Claude with Claude Agent SDK TypeScript client",
  131. "type": "shell",
  132. "command": "/data/agent-manager/scripts/handle-issue-ts.sh",
  133. "args": ["{{repo_owner}}", "{{repo}}", "{{pusher}}", "{{issue_number}}", "{{issue_title}}", "{{issue_body}}", "{{issue_action}}", "{{comment_body}}", "{{issue_assignee}}"],
  134. "cwd": "~",
  135. "timeout": 600000,
  136. "filterBranch": null
  137. },
  138. {
  139. "name": "check-comment-commands",
  140. "description": "Check for special commands in comments",
  141. "type": "shell",
  142. "command": "/path/to/check-comment-commands.sh",
  143. "args": ["{{comment_body}}", "{{issue_number}}"],
  144. "cwd": null,
  145. "timeout": 300000,
  146. "filterBranch": null
  147. }
  148. ],
  149. "global": [
  150. {
  151. "name": "log-all-events",
  152. "description": "Log all webhook events (runs for every event)",
  153. "type": "shell",
  154. "command": "echo",
  155. "args": ["Webhook {{event}} received for {{repo}}"],
  156. "cwd": null,
  157. "timeout": 300000,
  158. "filterBranch": null
  159. }
  160. ]
  161. }
  162. }