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
30 changes: 10 additions & 20 deletions .github/workflows/openapi-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,18 @@ jobs:
with:
ref: ${{ github.base_ref }}
path: base
- name: Generate oasdiff changelog
- name: Generate oasdiff summary
id: oasdif_changelog
run: | # Capture changelog as a multiline output
echo "changelog<<EOF" > $GITHUB_OUTPUT
docker run --rm \
run: |
SUMMARY=$(docker run --rm \
--workdir ${{ github.workspace }} \
--volume ${{ github.workspace }}:${{ github.workspace }}:rw \
-e GITHUB_WORKSPACE=${{ github.workspace }} \
tufin/oasdiff changelog --composed \
tufin/oasdiff changelog --composed --flatten-allof \
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See https://github.com/oasdiff/oasdiff/blob/main/docs/ALLOF.md, -flatten-allof helps reduce some false positives

'base/openapi/specs/*.yaml' \
'head/openapi/specs/*.yaml' \
>> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Get summary
id: oasdif_summary
run: |
echo summary=$(echo "${{ steps.oasdif_changelog.outputs.changelog }}" | head -1 ) \
>> $GITHUB_OUTPUT
| head -1)
echo "summary=$SUMMARY" >> $GITHUB_OUTPUT
- name: Find existing comment
id: find_comment
uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4
Expand All @@ -43,7 +37,7 @@ jobs:
- name: Post changes as comment
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5
# Even if no changes, make sure to update old comment if it was found.
if: steps.oasdif_summary.outputs.summary || steps.find_comment.outputs.comment-id
if: steps.oasdif_changelog.outputs.summary || steps.find_comment.outputs.comment-id
with:
token: ${{ secrets.GITHUB_TOKEN }}
edit-mode: "replace"
Expand All @@ -53,15 +47,11 @@ jobs:
body: |
## OpenAPI Changes
<details>
<summary>Show/hide ${{ steps.oasdif_summary.outputs.summary || 'No detectable change.' }}</summary>
${{ steps.oasdif_changelog.outputs.summary || 'No detectable change.' }}
```
${{ steps.oasdif_changelog.outputs.changelog }}
```
[View full changelog](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link to the details instead of posting all of the changelog... in this case, it was bigger than the comment could handle

Unexpected changes? Ensure your branch is up-to-date with `main` (consider rebasing).
</details>
- name: Check for breaking changes
id: oasdif_breaking
run: |
Expand All @@ -72,6 +62,6 @@ jobs:
tufin/oasdiff breaking \
--fail-on ERR \
--format githubactions \
--composed \
--composed --flatten-allof \
'base/openapi/specs/*.yaml' \
'head/openapi/specs/*.yaml'
78 changes: 54 additions & 24 deletions frontends/api/src/generated/v0/api.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading