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
24 changes: 24 additions & 0 deletions .github/workflows/api-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 "<!-- api-spec-workflow -->"
echo "## ⚠️ API specification β€” non-breaking changes"
echo ""
echo "<details><summary>API changes</summary>"
echo ""
cat changelog.md
echo ""
echo "</details>"
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 \
Expand All @@ -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 "<!-- api-spec-workflow -->"
echo "## πŸ›‘ API specification β€” breaking changes detected"
echo ""
if [ -s changelog.md ]; then
echo "<details><summary>API changes</summary>"
echo ""
cat changelog.md
echo ""
echo "</details>"
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 \
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down