Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,29 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Java
if: matrix.os == 'windows-latest'
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21

- name: Run action
uses: ./

- name: Get version
run: openapi-generator-cli version

- name: Run action with version
uses: ./
with:
version: 2.3.4
version: 7.9.0

- name: Check version
shell: bash
run: |
if [[ $(openapi-generator-cli version) != '7.9.0' ]]; then
echo 'Version does not match. See version below:'
openapi-generator-cli --version
exit 1
fi
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup OpenAPI
uses: remarkablemark/setup-openapi@v1

- name: Generate Ruby client from spec
- name: Generate Ruby Client
run: openapi-generator-cli generate -i petstore.yaml -g ruby -o /tmp/test/
```

Expand All @@ -30,6 +30,12 @@ Install OpenAPI Generator CLI tool:
- uses: remarkablemark/setup-openapi@v1
```

Generate a Ruby client from a valid [petstore.yaml](https://petstore3.swagger.io/) doc:

```yaml
- run: openapi-generator-cli generate -i petstore.yaml -g ruby -o /tmp/test/
```

See [action.yml](action.yml)

## Inputs
Expand Down
12 changes: 8 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ inputs:
runs:
using: composite
steps:
- name: Print version
shell: bash
run: |
echo "version: $VERSION"
- name: Install OpenAPI Generator CLI
shell: sh
run: npm install --global @openapitools/openapi-generator-cli

- name: Set OpenAPI Generator Version
if: inputs.version
shell: sh
run: openapi-generator-cli version-manager set $VERSION
env:
VERSION: ${{ inputs.version }}

Expand Down