GitHub actions for comparing OpenAPI specs and detect breaking changes, based on oasdiff tool
Depends on your use case:
Copy and paste the following snippet into your build .yml file:
- name: Running OpenAPI Spec diff action
id: test_ete
uses: oasdiff/oasdiff-action/diff@main
with:
base: 'specs/base.yaml'
revision: 'specs/revision.yaml'
format: 'text'
fail-on-diff: false
Copy and paste the following snippet into your build .yml file:
- name: Running OpenAPI Spec diff action
id: test_ete
uses: oasdiff/oasdiff-action/check-breaking@main
with:
base: https://raw.githubusercontent.com/Tufin/oasdiff/main/data/openapi-test1.yaml
revision: https://raw.githubusercontent.com/Tufin/oasdiff/main/data/openapi-test3.yaml
fail-on-diff: true
In order to ensure even stricter breaking policies, oasdiff provides with a few optional checks. Complete list can be found here.
These checks can be added by filling the include-checks
argument in the action like the following:
- name: Running OpenAPI Spec diff action
id: test_ete
uses: oasdiff/oasdiff-action/check-breaking@main
with:
base: https://raw.githubusercontent.com/Tufin/oasdiff/main/data/openapi-test1.yaml
revision: https://raw.githubusercontent.com/Tufin/oasdiff/main/data/openapi-test3.yaml
fail-on-diff: true
include-checks: "response-non-success-status-removed,api-operation-id-removed"
Copy and paste the following snippet into your build .yml file:
- name: Running OpenAPI Spec diff action
id: test_ete
uses: oasdiff/oasdiff-action/changelog@main
with:
base: https://raw.githubusercontent.com/Tufin/oasdiff/main/data/openapi-test1.yaml
revision: https://raw.githubusercontent.com/Tufin/oasdiff/main/data/openapi-test3.yaml