Skip to content

Commit e31d859

Browse files
docs: add git revision syntax section
1 parent 5369a4d commit e31d859

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,31 @@
33

44
GitHub Actions for comparing OpenAPI specs and detecting breaking changes, based on [oasdiff](https://github.com/oasdiff/oasdiff).
55

6+
## Spec sources
7+
8+
The `base` and `revision` inputs accept:
9+
10+
| Format | Example |
11+
|---|---|
12+
| Local file path | `specs/base.yaml` |
13+
| http/s URL | `https://example.com/openapi.yaml` |
14+
| Git revision | `origin/${{ github.base_ref }}:openapi.yaml` |
15+
16+
Git revision syntax (`<ref>:<path>`) lets you compare specs directly from git history without extra checkout steps. `fetch-depth: 0` is required in `actions/checkout` when using git revisions.
17+
18+
```yaml
19+
- uses: actions/checkout@v6
20+
with:
21+
fetch-depth: 0
22+
23+
- uses: oasdiff/oasdiff-action/breaking@v0.0.31
24+
with:
25+
base: 'origin/${{ github.base_ref }}:openapi.yaml'
26+
revision: 'HEAD:openapi.yaml'
27+
```
28+
29+
---
30+
631
## Free actions
732
833
The following actions run the oasdiff CLI directly in your GitHub runner — no account or token required.

0 commit comments

Comments
 (0)