I couldn't get https://github.com/evereepay/openapi-diff-action to work for me, so ended up doing it a bit more manually, by invoking directly https://github.com/quen2404/openapi-diff and generating a comment for the PR with https://github.com/actions/github-script
To do that you need :
- the script
check-openapi-diff.sh
... in my case it is in the.ci
folder at the root of our repo - the GitHub Actions workflow
openapi.yaml
. It needs to be under the folder.github/workflows
of the repo - possibly adapt some paths here and there in the
openapi.yaml
file
If everything goes well, you'll get comments on you PRs such as :
ℹ️ This is not preventing you from merging, you are an adult.
Changed content type : application/json
New required properties:
thisIsANewRequiredProp
- Added property
thisIsANewRequiredProp
(boolean)
comparing /home/runner/work/xxxx/xxxx/base/docs/swagger.yaml
with /home/runner/work/xxxx/xxxxx/head/docs/swagger.yaml
.
or
ℹ️ This is not preventing you from merging, you are an adult.
Changed content type : application/json
- Added property
newOptionalProp
(string)
comparing /home/runner/work/xxxx/xxx/base/docs/swagger.yaml
with /home/runner/work/xxxx/xxxx/head/docs/swagger.yaml
.
or
ℹ️ This is not preventing you from merging, you are an adult.
comparing /home/runner/work/xxxx/xxxx/base/docs/swagger.yaml
with /home/runner/work/xxxx/xxxx/head/docs/swagger.yaml
.
Oh, I think we had the issue a while ago, and fixed it. I had forgotten about this
gist
.... I'll update it with our changes