From 71031dc62a8bee32f562362f9a1db20e2c6e0c18 Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Thu, 28 May 2026 19:34:30 +0300 Subject: [PATCH] Step Summary: include the CLI command as a copyable code block MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Step 5 of cli-local-review.md Phase 1. The breaking and changelog actions' Step Summary already emits a clickable link to the free /review instruction page; this adds the CLI command itself as a fenced code block alongside the link. GitHub renders the code block with a built-in copy button, so visitors who recognize the command can copy from the PR's Checks tab and skip the instruction-page detour entirely. For the visitor cohort that doesn't recognize the command, the link is still there and lands them on the instruction page, which hands them the same pre-filled command with explanatory copy. The fallback for visitors on older oasdiff-action versions (no embedded command) is the same instruction page — that's the design intent that the wall-replacement covers. Co-Authored-By: Claude Opus 4.7 (1M context) --- breaking/entrypoint.sh | 17 ++++++++++++++++- changelog/entrypoint.sh | 15 ++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/breaking/entrypoint.sh b/breaking/entrypoint.sh index c5fdd88..8033425 100755 --- a/breaking/entrypoint.sh +++ b/breaking/entrypoint.sh @@ -134,7 +134,22 @@ if [ -n "$breaking_changes" ] && ! echo "$breaking_changes" | head -n 1 | grep - if [ -z "$base_sha" ]; then base_sha=$(git rev-parse "origin/$GITHUB_BASE_REF" 2>/dev/null || echo "$GITHUB_BASE_REF"); fi free_review_url="https://www.oasdiff.com/review?owner=${owner}&repo=${repo}&base_sha=$(urlencode "$base_sha")&rev_sha=${head_sha}&base_file=$(urlencode "$base_path")&rev_file=$(urlencode "$rev_path")" echo "::notice::📋 Review & approve these breaking changes → ${free_review_url}" - echo "### 📋 [Review & approve these breaking changes](${free_review_url})" >> "$GITHUB_STEP_SUMMARY" + # The Step Summary surfaces both the link (for visitors who'd rather use + # the web UI) and the CLI command itself (for visitors who recognize it + # and want to skip the instruction-page detour). GitHub renders the + # fenced code block with a built-in copy button, so the one-step path + # for the familiar-visitor cohort is: scroll to the Checks tab, click + # copy on the command, paste into a terminal in the local clone, run. + # See enterprise/docs/cli-local-review.md (Phase 1, step 5). + { + echo "### 📋 [Review & approve these breaking changes](${free_review_url})" + echo "" + echo "Or run locally in your clone of \`${repo}\`:" + echo "" + echo '```bash' + echo "oasdiff breaking ${base_sha}:${base_path} ${head_sha}:${rev_path} --open" + echo '```' + } >> "$GITHUB_STEP_SUMMARY" else write_output "No breaking changes" fi diff --git a/changelog/entrypoint.sh b/changelog/entrypoint.sh index 090475e..1aebe8a 100755 --- a/changelog/entrypoint.sh +++ b/changelog/entrypoint.sh @@ -125,7 +125,20 @@ if [ -n "$output" ] && ! echo "$output" | head -n 1 | grep -q "^No "; then if [ -z "$base_sha" ]; then base_sha=$(git rev-parse "origin/$GITHUB_BASE_REF" 2>/dev/null || echo "$GITHUB_BASE_REF"); fi free_review_url="https://www.oasdiff.com/review?owner=${owner}&repo=${repo}&base_sha=$(urlencode "$base_sha")&rev_sha=${head_sha}&base_file=$(urlencode "$base_path")&rev_file=$(urlencode "$rev_path")" echo "::notice::📋 Review & approve these API changes → ${free_review_url}" - echo "### 📋 [Review & approve these API changes](${free_review_url})" >> "$GITHUB_STEP_SUMMARY" + # The Step Summary surfaces both the link (for visitors who'd rather use + # the web UI) and the CLI command itself (for visitors who recognize it + # and want to skip the instruction-page detour). GitHub renders the + # fenced code block with a built-in copy button. See + # enterprise/docs/cli-local-review.md (Phase 1, step 5). + { + echo "### 📋 [Review & approve these API changes](${free_review_url})" + echo "" + echo "Or run locally in your clone of \`${repo}\`:" + echo "" + echo '```bash' + echo "oasdiff changelog ${base_sha}:${base_path} ${head_sha}:${rev_path} --open" + echo '```' + } >> "$GITHUB_STEP_SUMMARY" else write_output "No changelog changes" fi