Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/swimmwatch/openapi-diff-action
A GitHub Action to identify differences between OpenAPI specifications. It uses OpenAPITools/openapi-diff.
https://github.com/swimmwatch/openapi-diff-action
github-actions openapi openapi-spec
Last synced: 23 days ago
JSON representation
A GitHub Action to identify differences between OpenAPI specifications. It uses OpenAPITools/openapi-diff.
- Host: GitHub
- URL: https://github.com/swimmwatch/openapi-diff-action
- Owner: swimmwatch
- License: mit
- Created: 2022-05-06T08:37:53.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-01-29T02:27:18.000Z (9 months ago)
- Last Synced: 2024-03-14T20:22:06.184Z (8 months ago)
- Topics: github-actions, openapi, openapi-spec
- Homepage:
- Size: 23.4 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# openapi-diff-action
A GitHub Action to identify differences between OpenAPI specifications. It uses [OpenAPITools/openapi-diff](https://github.com/OpenAPITools/openapi-diff).## Usage
The following example [workflow step](https://help.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow) will generate JSON and Markdown difference contents.
```yml
- name: "Find difference between OpenAPI specifications"
id: diff_state
uses: swimmwatch/[email protected]
with:
old-spec: "old_spec.json"
new-spec: "new_spec.json"
json: "out.json"
markdown: "out.md"
- name: "Print difference state"
run: echo "Current state: ${{steps.diff_state.outputs.state}}."
```## Options
The following input variables options can/must be configured:|Input variable|Necessity|Description|Default|
|----|----|----|----|
|`old-spec`|Required|Path to old version OpenAPI specification.||
|`new-spec`|Required|Path to new version OpenAPI specification.||
|`header`|Optional|Use given header for authorization. Format: `` |`''`|
|`query`|Optional|Use given query for authorization. Format: `` |`''`|
|`log`|Optional|Use given level for log. Expected values: (`TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `OFF`) |`ERROR`|
|`markdown`|Optional|Export diff as markdown in given file. |`'.tmp/markdown'`|
|`json`|Optional|Export diff as JSON in given file. |`'.tmp/json'`|
|`text`|Optional|Export diff as text in given file. |`'.tmp/text'`|
|`html`|Optional|Export diff as HTML in given file. |`'.tmp/html'`|
|`fail-on`|Optional|Fail if API changed but is backward compatible (`changed` value) or changes broke backward compatibility (`incompatible` value). |`''`|## Outputs
- `state`: Output diff state: `no_changes`, `incompatible`, `compatible`.## License
openapi-diff-action is licensed under the [MIT License](LICENSE).