|
3 | 3 |
|
4 | 4 | GitHub Actions for comparing OpenAPI specs and detecting breaking changes, based on [oasdiff](https://github.com/oasdiff/oasdiff). |
5 | 5 |
|
| 6 | +## Contents |
| 7 | + |
| 8 | +- [Quick start](#quick-start) |
| 9 | +- [Free actions](#free-actions) |
| 10 | + - [Check for breaking changes](#check-for-breaking-changes) |
| 11 | + - [Generate a changelog](#generate-a-changelog) |
| 12 | + - [Generate a diff report](#generate-a-diff-report) |
| 13 | + - [Configuring with `oasdiff.yaml`](#configuring-with-oasdiffyaml) |
| 14 | +- [Spec paths](#spec-paths) |
| 15 | +- [Pro: Rich PR comment](#pro-rich-pr-comment) |
| 16 | + |
6 | 17 | ## Quick start |
7 | 18 |
|
8 | 19 | Add this workflow to `.github/workflows/oasdiff.yaml` to block PRs that introduce breaking API changes. |
@@ -34,25 +45,6 @@ This compares your spec on the PR branch against the base branch and fails the w |
34 | 45 |
|
35 | 46 | The following actions run the oasdiff CLI directly in your GitHub runner — no account or token required. |
36 | 47 |
|
37 | | -### Configuring with `oasdiff.yaml` |
38 | | - |
39 | | -All free actions inherit the CLI's config-file support. Drop an `oasdiff.yaml` at your repo root and the actions pick it up automatically — no extra wiring needed: |
40 | | - |
41 | | -```yaml |
42 | | -# oasdiff.yaml at your repo root |
43 | | -exclude-elements: |
44 | | - - endpoints |
45 | | -flatten-allof: true |
46 | | -deprecation-days-stable: 180 |
47 | | -fail-on: ERR |
48 | | -``` |
49 | | - |
50 | | -Any flag the oasdiff CLI supports works in the config file — see [CONFIG-FILES.md](https://github.com/oasdiff/oasdiff/blob/main/docs/CONFIG-FILES.md) for the full reference and supported file formats (`oasdiff.{json,yaml,yml,toml,hcl}`). |
51 | | - |
52 | | -Action `inputs:` take precedence over config-file values, so you can use the file for shared defaults across workflows and override per-workflow via inputs. |
53 | | - |
54 | | -> **Limitation**: boolean flags can only be enabled through an action input. If your `oasdiff.yaml` sets `composed: true` and you want to disable it for a specific workflow run, edit the YAML — passing `composed: 'false'` in the action input has no effect. |
55 | | - |
56 | 48 | ### Check for breaking changes |
57 | 49 |
|
58 | 50 | Detects breaking changes and writes inline GitHub annotations to the Actions summary. Fails the workflow when changes at or above the `fail-on` severity are found. |
@@ -164,6 +156,25 @@ jobs: |
164 | 156 | | `flatten-allof` | `false` | Merge allOf subschemas into a single schema before diff | `true`, `false` | |
165 | 157 | | `output-to-file` | `''` | Write output to this file path instead of stdout | file path | |
166 | 158 |
|
| 159 | +### Configuring with `oasdiff.yaml` |
| 160 | + |
| 161 | +All free actions inherit the CLI's config-file support. Drop an `oasdiff.yaml` at your repo root and the actions pick it up automatically — no extra wiring needed: |
| 162 | + |
| 163 | +```yaml |
| 164 | +# oasdiff.yaml at your repo root |
| 165 | +exclude-elements: |
| 166 | + - endpoints |
| 167 | +flatten-allof: true |
| 168 | +deprecation-days-stable: 180 |
| 169 | +fail-on: ERR |
| 170 | +``` |
| 171 | + |
| 172 | +Any flag the oasdiff CLI supports works in the config file — see [CONFIG-FILES.md](https://github.com/oasdiff/oasdiff/blob/main/docs/CONFIG-FILES.md) for the full reference and supported file formats (`oasdiff.{json,yaml,yml,toml,hcl}`). |
| 173 | + |
| 174 | +Action `inputs:` take precedence over config-file values, so you can use the file for shared defaults across workflows and override per-workflow via inputs. |
| 175 | + |
| 176 | +> **Limitation**: action inputs can only turn a boolean flag *on*, not *off*. If your `oasdiff.yaml` sets `composed: true`, passing `composed: 'false'` to the action has no effect — to disable it for a specific workflow run, edit the YAML. |
| 177 | + |
167 | 178 | --- |
168 | 179 |
|
169 | 180 | ## Spec paths |
|
0 commit comments