https://github.com/oasdiff/oasdiff-action
GitHub action for comparing and detect breaking changes in OpenAPI specs
https://github.com/oasdiff/oasdiff-action
Last synced: 8 months ago
JSON representation
GitHub action for comparing and detect breaking changes in OpenAPI specs
- Host: GitHub
- URL: https://github.com/oasdiff/oasdiff-action
- Owner: oasdiff
- License: apache-2.0
- Created: 2023-05-11T15:04:31.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-10T11:04:59.000Z (11 months ago)
- Last Synced: 2025-06-07T07:41:57.438Z (8 months ago)
- Language: Shell
- Homepage:
- Size: 68.4 KB
- Stars: 44
- Watchers: 5
- Forks: 27
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: changelog/Dockerfile
- License: LICENSE
Awesome Lists containing this project
README
# oasdiff-action
[](https://github.com/oasdiff/oasdiff-action/actions)
GitHub actions for comparing OpenAPI specs and detect breaking changes, based on [oasdiff](https://github.com/oasdiff/oasdiff) tool
## How to use?
Depending on your use case, refer below for instructions on generating reports for differences, breaking changes and changelog.
### Generate a diff report
Copy and paste the following snippet into your build .yml file:
```
- name: Running OpenAPI Spec diff action
uses: oasdiff/oasdiff-action/diff@main
with:
base: 'specs/base.yaml'
revision: 'specs/revision.yaml'
```
This action supports additional arguments. Most are converted to parameters for the `oasdiff` CLI.
| CLI | Action input | Default |
| --------------------- | ------------------- | ------- |
| --fail-on-diff | fail-on-diff | false |
| --format | format | yaml |
| --include-path-params | include-path-params | false |
| --exclude-elements | exclude-elements | '' |
| --composed | composed | false |
| N/A | output-to-file | '' |
### Check for breaking API changes, and fail if any are found
Copy and paste the following snippet into your build .yml file:
```
- name: Running OpenAPI Spec diff action
uses: oasdiff/oasdiff-action/breaking@main
with:
base: https://raw.githubusercontent.com/oasdiff/oasdiff/main/data/openapi-test1.yaml
revision: https://raw.githubusercontent.com/oasdiff/oasdiff/main/data/openapi-test3.yaml
```
Additional arguments:
| CLI | Action input | Default |
| ------------------------- | ----------------------- | ------- |
| --fail-on | fail-on | empty |
| --include-checks | include-checks | csv |
| --include-path-params | include-path-params | false |
| --deprecation-days-beta | deprecation-days-beta | 31 |
| --deprecation-days-stable | deprecation-days-stable | 180 |
| --exclude-elements | exclude-elements | '' |
| --composed | composed | false |
| N/A | output-to-file | '' |
This action delivers a summary of breaking changes, accessible as a GitHub step output named `breaking`.
### Generate a changelog
Copy and paste the following snippet into your build .yml file:
```
- name: Running OpenAPI Spec diff action
uses: oasdiff/oasdiff-action/changelog@main
with:
base: https://raw.githubusercontent.com/oasdiff/oasdiff/main/data/openapi-test1.yaml
revision: https://raw.githubusercontent.com/oasdiff/oasdiff/main/data/openapi-test3.yaml
```
Additional arguments:
| CLI | Action input | Default |
| --------------------- | ------------------- | ------- |
| --include-path-params | include-path-params | false |
| --exclude-elements | exclude-elements | '' |
| --composed | composed | false |
| N/A | output-to-file | '' |