File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818 - name : Run action
1919 uses : ./
2020
21+ - name : Get version
22+ run : openapi-generator-cli version
23+
2124 - name : Run action with version
2225 uses : ./
2326 with :
24- version : 2.3.4
27+ version : 7.9.0
28+
29+ - name : Check version
30+ shell : bash
31+ run : |
32+ if [[ $(openapi-generator-cli version) != '7.9.0' ]]; then
33+ echo 'Version does not match. See version below:'
34+ openapi-generator-cli --version
35+ exit 1
36+ fi
Original file line number Diff line number Diff line change 1818 - name : Setup OpenAPI
1919 uses : remarkablemark/setup-openapi@v1
2020
21- - name : Generate Ruby client from spec
21+ - name : Generate Ruby Client
2222 run : openapi-generator-cli generate -i petstore.yaml -g ruby -o /tmp/test/
2323` ` `
2424
@@ -30,6 +30,12 @@ Install OpenAPI Generator CLI tool:
3030- uses : remarkablemark/setup-openapi@v1
3131` ` `
3232
33+ Generate a Ruby client from a valid [petstore.yaml](https://petstore3.swagger.io/) doc:
34+
35+ ` ` ` yaml
36+ - run : openapi-generator-cli generate -i petstore.yaml -g ruby -o /tmp/test/
37+ ` ` `
38+
3339See [action.yml](action.yml)
3440
3541## Inputs
Original file line number Diff line number Diff line change @@ -10,10 +10,14 @@ inputs:
1010runs :
1111 using : composite
1212 steps :
13- - name : Print version
14- shell : bash
15- run : |
16- echo "version: $VERSION"
13+ - name : Install OpenAPI Generator CLI
14+ shell : sh
15+ run : npm install --global @openapitools/openapi-generator-cli
16+
17+ - name : Set OpenAPI Generator Version
18+ if : inputs.version
19+ shell : sh
20+ run : openapi-generator-cli version-manager set $VERSION
1721 env :
1822 VERSION : ${{ inputs.version }}
1923
You can’t perform that action at this time.
0 commit comments