Skip to content

Commit 662e511

Browse files
feat: emit ::notice:: upgrade link when breaking changes found
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b6a4ed5 commit 662e511

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Each **Review** link opens a hosted page with a side-by-side spec diff and **App
158158
|---|---|---|---|
159159
| `base` | — (required) | Path to the base (old) OpenAPI spec | file path, URL, git ref |
160160
| `revision` | — (required) | Path to the revised (new) OpenAPI spec | file path, URL, git ref |
161-
| `oasdiff-token` | — (required) | oasdiff API token — [sign up at oasdiff.com](https://oasdiff.com) | — |
161+
| `oasdiff-token` | — (required) | oasdiff API token — [get one at oasdiff.com/pricing](https://oasdiff.com/pricing) | — |
162162
| `github-token` | `${{ github.token }}` | GitHub token for posting the PR comment; requires `pull-requests: write`, `statuses: write` | — |
163163
| `include-path-params` | `false` | Include path parameter names in endpoint matching | `true`, `false` |
164164
| `exclude-elements` | `''` | Exclude certain kinds of changes from the output | `endpoints`, `request`, `response` (comma-separated) |

breaking/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM tufin/oasdiff:stable
2+
RUN apk add --no-cache jq
23
ENV PLATFORM github-action
34
COPY entrypoint.sh /entrypoint.sh
45
ENTRYPOINT ["/entrypoint.sh"]

breaking/entrypoint.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ echo "breaking<<$delimiter" >>"$GITHUB_OUTPUT"
101101

102102
if [ -n "$breaking_changes" ]; then
103103
write_output "$(echo "$breaking_changes" | head -n 1)" "$breaking_changes"
104+
# Emit upgrade notice pointing to the free review page
105+
urlencode() { printf '%s' "$1" | jq -sRr @uri; }
106+
base_path=$(echo "$base" | sed 's/.*://')
107+
rev_path=$(echo "$revision" | sed 's/.*://')
108+
owner="${GITHUB_REPOSITORY%%/*}"
109+
repo="${GITHUB_REPOSITORY#*/}"
110+
head_sha=$(jq -r '.pull_request.head.sha // empty' "$GITHUB_EVENT_PATH" 2>/dev/null || echo "")
111+
if [ -z "$head_sha" ]; then head_sha="$GITHUB_SHA"; fi
112+
free_review_url="https://www.oasdiff.com/review?owner=${owner}&repo=${repo}&base_sha=$(urlencode "$GITHUB_BASE_REF")&rev_sha=${head_sha}&base_file=$(urlencode "$base_path")&rev_file=$(urlencode "$rev_path")"
113+
echo "::notice::📋 Review & approve these breaking changes → ${free_review_url}"
104114
else
105115
write_output "No breaking changes"
106116
fi

0 commit comments

Comments
 (0)