Skip to content

Commit 9802ce9

Browse files
committed
feat(comment): clarify color legend (file-level changes) + add workspace/extension CTA via click proxy
1 parent e00323a commit 9802ce9

3 files changed

Lines changed: 28 additions & 3 deletions

File tree

.github/workflows/example-usage.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Architecture diff
22

3+
# Reference example only (the README shows the real pull_request usage). Manual
4+
# trigger so it doesn't run the published @v1 against this repo's own PRs.
35
on:
4-
pull_request:
5-
types: [opened, synchronize, reopened, ready_for_review]
6+
workflow_dispatch:
67

78
# Only a PR comment is posted — no image is pushed — so contents:write is not needed.
89
permissions:

.github/workflows/test-self.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ jobs:
2121
llm_api_key: ${{ secrets.OPENROUTER_API_KEY }}
2222
agent_model: ${{ secrets.AGENT_MODEL }}
2323
parsing_model: ${{ secrets.PARSING_MODEL }}
24+
cta_base_url: https://codeboarding.pontux-inc.workers.dev

action.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ inputs:
4646
description: 'Draw depth>1 sub-components as nested subgraphs (pair with depth_level >= 2).'
4747
required: false
4848
default: 'false'
49+
cta_base_url:
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+
required: false
52+
default: ''
4953

5054
outputs:
5155
diagram_md:
@@ -340,12 +344,30 @@ runs:
340344
TRUNC="${{ steps.diagram.outputs.truncated }}"
341345
BODY_FILE=$(mktemp)
342346
347+
OWNER_REPO="${{ github.repository }}"
348+
OWNER="${OWNER_REPO%%/*}"; REPO="${OWNER_REPO##*/}"
349+
PR="${{ steps.guard.outputs.pr_number }}"
350+
CTA_BASE="${{ inputs.cta_base_url }}"
351+
343352
headline() {
344353
if [ "$1" = "0" ]; then echo "no architectural changes";
345354
elif [ "$1" = "1" ]; then echo "1 component changed";
346355
else echo "$1 components changed"; fi
347356
}
348357
358+
# Call-to-action: links open the live workspace (github.dev-equivalent) and
359+
# the extension via the click proxy, with owner/repo/pr appended for tracking.
360+
cta() {
361+
[ -z "$CTA_BASE" ] && return
362+
local ws="${CTA_BASE}/use-workspace?owner=${OWNER}&repo=${REPO}&pr=${PR}"
363+
local mp="${CTA_BASE}/use-marketplace?owner=${OWNER}&repo=${REPO}&pr=${PR}"
364+
echo ""
365+
echo "---"
366+
echo "🔍 **This is the flattened map.** [**Explore it live in your browser →**](${ws}) — expand each component, follow every dependency, and click straight through to the code that changed. No install; it opens right here on this PR."
367+
echo ""
368+
echo "💡 Want this on every PR? [**Add the CodeBoarding extension →**](${mp})"
369+
}
370+
349371
{
350372
echo "### ${HEADER} · $(headline "$N")"
351373
echo ""
@@ -355,14 +377,15 @@ runs:
355377
cat "${{ steps.diagram.outputs.diagram_md }}"
356378
echo ""
357379
echo ""
358-
echo "🟩 added · 🟨 modified · 🟥 deletedcompared against \`${BASE_REF}\`."
380+
echo "Components are tinted by the files that changed inside them — 🟩 added · 🟨 modified · 🟥 removedversus \`${BASE_REF}\` (not whole subsystems being added or dropped)."
359381
if [ "$TRUNC" = "true" ]; then
360382
echo ""
361383
echo "<sub>Showing changed components only — the full graph exceeds GitHub's inline Mermaid limit.</sub>"
362384
fi
363385
else
364386
echo "**$(headline "$N")** versus \`${BASE_REF}\`, but the diagram is too large to render inline (GitHub caps inline Mermaid at 500 edges)."
365387
fi
388+
cta
366389
echo ""
367390
echo "<sub>codeboarding-action · run ${{ github.run_id }}</sub>"
368391
} > "$BODY_FILE"

0 commit comments

Comments
 (0)