Skip to content

Commit 435ae2d

Browse files
Less noisy openapi-diff action. (#2236)
* try peter evans version * test a breaking change * try it this way * edit-mode replace * remove breaking change * post summary conditionally temp * test a breaking change * fix breaking change * add a note aboute rebasing * tweak comment
1 parent e3621b6 commit 435ae2d

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

.github/workflows/openapi-diff.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,25 @@ jobs:
3232
run: |
3333
echo summary=$(echo "${{ steps.oasdif_changelog.outputs.changelog }}" | head -1 ) \
3434
>> $GITHUB_OUTPUT
35+
- name: Find existing comment
36+
id: find_comment
37+
uses: peter-evans/find-comment@v3
38+
with:
39+
token: ${{ secrets.GITHUB_TOKEN }}
40+
repository: ${{ github.repository }}
41+
issue-number: ${{ github.event.pull_request.number }}
42+
body-includes: "## OpenAPI Changes"
3543
- name: Post changes as comment
36-
uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3
44+
uses: peter-evans/create-or-update-comment@v3
45+
# Even if no changes, make sure to update old comment if it was found.
46+
if: steps.oasdif_summary.outputs.summary || steps.find_comment.outputs.comment-id
3747
with:
38-
message: |
48+
token: ${{ secrets.GITHUB_TOKEN }}
49+
edit-mode: "replace"
50+
repository: ${{ github.repository }}
51+
issue-number: ${{ github.event.pull_request.number }}
52+
comment-id: ${{ steps.find_comment.outputs.comment-id }}
53+
body: |
3954
## OpenAPI Changes
4055
4156
<details>
@@ -44,9 +59,9 @@ jobs:
4459
```
4560
${{ steps.oasdif_changelog.outputs.changelog }}
4661
```
62+
63+
Unexpected changes? Ensure your branch is up-to-date with `main` (consider rebasing).
4764
</details>
48-
comment_tag: oasdiff_changelog
49-
mode: upsert
5065
- name: Check for breaking changes
5166
id: oasdif_breaking
5267
run: |

0 commit comments

Comments
 (0)