Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM tufin/oasdiff:v1.15.0
RUN apk add --no-cache jq
ENV PLATFORM github-action
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
11 changes: 11 additions & 0 deletions changelog/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,17 @@ fi

if [ -n "$output" ] && ! echo "$output" | head -n 1 | grep -q "^No "; then
write_output "$output"
# Emit upgrade notice pointing to the free review page
urlencode() { printf '%s' "$1" | jq -sRr @uri; }
base_path=$(echo "$base" | sed 's/.*://')
rev_path=$(echo "$revision" | sed 's/.*://')
owner="${GITHUB_REPOSITORY%%/*}"
repo="${GITHUB_REPOSITORY#*/}"
head_sha=$(jq -r '.pull_request.head.sha // empty' "$GITHUB_EVENT_PATH" 2>/dev/null || echo "")
if [ -z "$head_sha" ]; then head_sha="$GITHUB_SHA"; fi
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")"
echo "::notice::📋 Review & approve these API changes → ${free_review_url}"
echo "### 📋 [Review & approve these API changes](${free_review_url})" >> "$GITHUB_STEP_SUMMARY"
else
write_output "No changelog changes"
fi
Expand Down
Loading