diff --git a/.github/workflows/api-spec.yml b/.github/workflows/api-spec.yml
index 2ee1d8b..8204cf2 100644
--- a/.github/workflows/api-spec.yml
+++ b/.github/workflows/api-spec.yml
@@ -98,6 +98,11 @@ jobs:
base: .api-spec-tmp/base.yaml
revision: .api-spec-tmp/revision.yaml
fail-on: ERR
+ # Upload to oasdiff.com to get a side-by-side review link (exposed as
+ # the review_url output), but suppress the action's own comment with an
+ # empty token ā we post a single combined comment below.
+ review: true
+ github-token: ""
- name: Generate changelog
id: changelog
@@ -108,6 +113,9 @@ jobs:
revision: .api-spec-tmp/revision.yaml
format: markdown
output-to-file: changelog.md
+ # As above: keep the upload/review_url output, suppress the auto-comment.
+ review: true
+ github-token: ""
- name: Determine whether the spec changed
id: changes
@@ -135,12 +143,20 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
PREV_ID: ${{ steps.prev-comment.outputs.id }}
+ REVIEW_URL: ${{ steps.changelog.outputs.review_url }}
run: |
{
echo ""
echo "## ā ļø API specification ā non-breaking changes"
echo ""
+ echo "API changes
"
+ echo ""
cat changelog.md
+ echo ""
+ echo " "
+ if [ -n "$REVIEW_URL" ]; then
+ printf '\nš [View the full side-by-side review](%s)\n' "$REVIEW_URL"
+ fi
} > comment.md
if [ -n "$PREV_ID" ]; then
jq -Rs '{body: .}' < comment.md \
@@ -154,16 +170,24 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
PREV_ID: ${{ steps.prev-comment.outputs.id }}
+ REVIEW_URL: ${{ steps.breaking.outputs.review_url }}
run: |
{
echo ""
echo "## š API specification ā breaking changes detected"
echo ""
if [ -s changelog.md ]; then
+ echo "API changes
"
+ echo ""
cat changelog.md
+ echo ""
+ echo " "
else
echo "The breaking-changes check flagged incompatible changes. Review the workflow logs for details."
fi
+ if [ -n "$REVIEW_URL" ]; then
+ printf '\nš [View the full side-by-side review](%s)\n' "$REVIEW_URL"
+ fi
} > comment.md
if [ -n "$PREV_ID" ]; then
jq -Rs '{body: .}' < comment.md \
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c6233cd..24eaa0d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,8 @@ See [keep a changelog] for information about writing changes to this log.
## [Unreleased]
+- [PR-51](https://github.com/itk-dev/event-database-api/pull/51)
+ Show the API-spec diff summary inline in the PR comment (collapsed) alongside the oasdiff review link
- [PR-49](https://github.com/itk-dev/event-database-api/pull/49)
Bump oasdiff-action to v0.1.5 in the API-spec workflow
- [PR-48](https://github.com/itk-dev/event-database-api/pull/48)