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
| `cta_base_url` | empty | Click-proxy base URL: deep-links the editor link into VS Code/Cursor and adds a "get the extension" link (tracks owner/repo/pr). Empty links to the extension listing instead (GitHub strips `vscode:`/`cursor:` from comments). |
169
+
| `webview_base_url` | `https://app.codeboarding.org` | Hosted webview base URL. The PR comment adds an "explore in browser" link to this PR's head-vs-base diff. Needs `commit_head_analysis` (same-repo PRs only); omitted on forks. Set empty to disable. |
170
+
| `commit_head_analysis` | `true` | Commit the generated head `.codeboarding/analysis.json` (+ health report) to the PR branch so the webview can read it at the head SHA. Same-repo PRs only (the token is read-only on forks). |
Copy file name to clipboardExpand all lines: action.yml
+84-2Lines changed: 84 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,14 @@ inputs:
54
54
description: 'Base URL of the click proxy (e.g. https://go.codeboarding.org). When set, the editor link deep-links into VS Code/Cursor via the proxy and a "get the extension" link is added (owner/repo/pr tracked). Empty (default) links to the extension listing instead, since GitHub strips vscode:/cursor: schemes from comment links.'
55
55
required: false
56
56
default: ''
57
+
webview_base_url:
58
+
description: 'Base URL of the hosted webview (default https://app.codeboarding.org). The PR comment adds an "explore in browser" link deep-linking to this PR''s head-vs-base architecture diff. Requires the head analysis.json to be committed to the PR branch (commit_head_analysis), so it is omitted on fork PRs. Set empty to disable the webview link.'
59
+
required: false
60
+
default: 'https://app.codeboarding.org'
61
+
commit_head_analysis:
62
+
description: 'Commit the generated head .codeboarding/analysis.json (+ health report) back to the PR branch so the webview can fetch it at the head SHA. Same-repo PRs only (the token is read-only on forks). Required for the webview "explore in browser" link.'
63
+
required: false
64
+
default: 'true'
57
65
trigger_command:
58
66
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.'
PR_JSON="$(gh api "repos/${REPOSITORY}/pulls/${PR_NUMBER}" 2>/dev/null)" || skip "Could not fetch PR #$PR_NUMBER from the API."
138
148
BASE_SHA="$(printf '%s' "$PR_JSON" | python3 -c 'import json,sys;print(json.load(sys.stdin)["base"]["sha"])' 2>/dev/null)" || skip "Could not parse base SHA from the PR API."
139
149
HEAD_SHA="$(printf '%s' "$PR_JSON" | python3 -c 'import json,sys;print(json.load(sys.stdin)["head"]["sha"])' 2>/dev/null)" || skip "Could not parse head SHA from the PR API."
BASE_REPO="$(printf '%s' "$PR_JSON" | python3 -c 'import json,sys;print(json.load(sys.stdin)["base"]["repo"]["full_name"])' 2>/dev/null)" || skip "Could not parse base repo from the PR API."
142
153
HEAD_REPO="$(printf '%s' "$PR_JSON" | python3 -c 'import json,sys;print(json.load(sys.stdin)["head"]["repo"]["full_name"])' 2>/dev/null)" || skip "Could not parse head repo from the PR API."
@@ -151,9 +162,12 @@ runs:
151
162
echo "pr_number=$PR_NUMBER"
152
163
echo "base_sha=$BASE_SHA"
153
164
echo "head_sha=$HEAD_SHA"
165
+
echo "head_ref=$HEAD_REF"
154
166
echo "base_ref=$BASE_REF"
155
167
echo "base_repo=$BASE_REPO"
156
168
echo "head_repo=$HEAD_REPO"
169
+
# same_repo gates pushing the head analysis: forks give a read-only token.
170
+
if [ "$HEAD_REPO" = "$REPOSITORY" ]; then echo "same_repo=true"; else echo "same_repo=false"; fi
157
171
} >> "$GITHUB_OUTPUT"
158
172
echo "Resolved PR #$PR_NUMBER (base=$BASE_REPO@$BASE_SHA head=$HEAD_REPO@$HEAD_SHA) via $EVENT"
159
173
@@ -576,6 +590,62 @@ runs:
576
590
"${RUNNER_TEMP}/cb-agent-model" \
577
591
"${RUNNER_TEMP}/cb-parsing-model"
578
592
593
+
# Commit the generated head analysis (+ health report) to the PR branch so the
594
+
# hosted webview can fetch .codeboarding/analysis.json at the head SHA and open
595
+
# this PR's head-vs-base diff. Same-repo PRs only — the token is read-only on
596
+
# forks (the step is skipped there and the webview link is omitted). The push
597
+
# creates a NEW head commit; its SHA (webview_sha) is what the comment links to.
0 commit comments