You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: /codeboarding comment command to trigger on-demand (issue_comment)
Guard now resolves the PR from either a pull_request event or an issue_comment
'/codeboarding' command (comment body read from env, never interpolated -> no
injection; SHAs fetched via gh api). Reacts 👀 to acknowledge. Configurable via
trigger_command. Sticky comment + base_ref now use the resolved PR explicitly.
You need **one secret**: an LLM API key. OpenRouter is the default; pass your own model via the `agent_model` / `parsing_model` inputs if you prefer.
44
51
52
+
### On-demand: the `/codeboarding` command
53
+
54
+
Comment **`/codeboarding`** on any pull request to (re)run the diagram on demand — handy after the engine/baseline changes, or on draft PRs you don't auto-review. The action reacts with 👀 to acknowledge. Change the word via the `trigger_command` input.
55
+
56
+
> **Note:** GitHub runs `issue_comment` workflows from the **default branch's** copy of the workflow file. So the command only works once this workflow is merged to your default branch — a workflow that exists only on a feature branch won't respond to comments.
57
+
45
58
## Inputs
46
59
47
60
| Input | Default | Description |
@@ -57,6 +70,7 @@ You need **one secret**: an LLM API key. OpenRouter is the default; pass your ow
57
70
| `changed_only` | `false` | Draw only changed components and their incident edges. |
58
71
| `render_depth` | `1` | Component levels to **draw** in the PR diagram, independent of `depth_level`: `1`= top-level flat, `2` = +one nesting level as subgraphs. Analyze deep, display shallow. |
59
72
| `cta_base_url` | `''` | Base URL of a click proxy. When set, the comment adds "explore in browser" / "open in VS Code or Cursor" / "get the extension" links (with `owner`/`repo`/`pr` appended). Empty disables the CTA. |
73
+
| `trigger_command` | `/codeboarding` | PR-comment slash-command that triggers an on-demand run (requires the `issue_comment` trigger in your workflow). |
Copy file name to clipboardExpand all lines: action.yml
+53-9Lines changed: 53 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,10 @@ inputs:
50
50
description: 'Base URL of the click proxy (e.g. https://go.codeboarding.org). When set, the comment adds "open in workspace" / "get the extension" links with owner/repo/pr appended. Empty disables the CTA.'
51
51
required: false
52
52
default: ''
53
+
trigger_command:
54
+
description: 'Slash-command that triggers the action from a PR comment (issue_comment event). A comment whose first word is this runs the diagram on-demand.'
55
+
required: false
56
+
default: '/codeboarding'
53
57
54
58
outputs:
55
59
diagram_md:
@@ -65,20 +69,59 @@ outputs:
65
69
runs:
66
70
using: 'composite'
67
71
steps:
68
-
- name: Guard — PR event only
72
+
- name: Guard — resolve the target PR
69
73
id: guard
70
74
shell: bash
75
+
env:
76
+
GH_TOKEN: ${{ inputs.github_token }}
77
+
# Read from env, NEVER interpolated into the script — a comment body is
78
+
# untrusted input and must not reach the shell as code (injection).
79
+
COMMENT_BODY: ${{ github.event.comment.body }}
80
+
TRIGGER: ${{ inputs.trigger_command }}
81
+
EVENT: ${{ github.event_name }}
71
82
run: |
72
-
if [ -z "${{ github.event.pull_request.number }}" ]; then
73
-
echo "::warning::CodeBoarding Architecture Diff only runs on pull_request events. Skipping."
0 commit comments