Skip to content

Commit 7ab8f77

Browse files
committed
fixed logs of file path input and input param value
1 parent b4a000c commit 7ab8f77

File tree

6 files changed

+13
-14
lines changed

6 files changed

+13
-14
lines changed

.github/workflows/verify-action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ jobs:
1414
- name: openapi-github-action
1515
uses: ./
1616
with:
17-
file-path: './schemas/openapiv3.yml'
17+
filepath: './schemas/openapiv3.yml'

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This action validates whether the OpenAPI/Swagger schema file is valid or not
44

55
## Inputs
66

7-
### `file-path`
7+
### `filepath`
88

99
**Required** Path of the OpenAPI schema file. Default is `"openapi.yaml"` at root. Path starts root of github repo.
1010
For example, if your schema is in `schemas` folder.
@@ -17,13 +17,13 @@ root
1717
└── package-lock.json
1818
```
1919

20-
You should use `file_path: './schemas/file-path.yaml'`
20+
You should use `filepath: './schemas/openapi.yaml'`
2121

2222
## Example usage
2323

2424
```
2525
- name: 'validate openapi schema'
26-
uses: thiyagu08/validate-github-action@v1
26+
uses: thiyagu06/validate-github-action@v1
2727
with:
2828
filepath: 'openapi.yaml'
2929
```

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: 'openapi-validator-action'
22
author: 'Thiyagu GK'
33
description: 'This action validates if the OpenAPI/Swagger schema file is valid or not.'
44
inputs:
5-
file-path:
5+
filepath:
66
description: 'Path of openapi schema file'
77
required: true
88
default: 'openapi.yaml'

dist/index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18157,8 +18157,8 @@ const dir = process.env.GITHUB_WORKSPACE || __dirname
1815718157
const fullPath = path.resolve(dir, filePath)
1815818158
console.log(`schema file full path:${fullPath}`)
1815918159
try {
18160-
const SwaggerParser = __nccwpck_require__(2980);
18161-
let api = await SwaggerParser.validate(fullPath, {continueOnError:true, validate:{spec: false}});
18160+
const SwaggerParser = __nccwpck_require__(2980)
18161+
let api = await SwaggerParser.validate(fullPath, {continueOnError:true})
1816218162
console.log("API specification is valid ")
1816318163
}
1816418164
catch(err) {
@@ -18416,9 +18416,8 @@ const core = __nccwpck_require__(4247);
1841618416
const validate = __nccwpck_require__(282)
1841718417

1841818418
try {
18419-
// const filePath = core.getInput('file-path');
18420-
const filePath = "openapiv3.yml"
18421-
console.log(`file path ${filePath}!`);
18419+
const filePath = core.getInput('filepath');
18420+
console.log(`file path ${filePath}`);
1842218421
validate(filePath)
1842318422
} catch (error) {
1842418423
core.setFailed(error.message);

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ const core = require('@actions/core');
22
const validate = require('./validator')
33

44
try {
5-
const filePath = core.getInput('file-path');
6-
console.log(`file path ${filePath}!`);
5+
const filePath = core.getInput('filepath');
6+
console.log(`file path ${filePath}`);
77
validate(filePath)
88
} catch (error) {
99
core.setFailed(error.message);

validator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const dir = process.env.GITHUB_WORKSPACE || __dirname
1010
const fullPath = path.resolve(dir, filePath)
1111
console.log(`schema file full path:${fullPath}`)
1212
try {
13-
const SwaggerParser = require("@apidevtools/swagger-parser");
14-
let api = await SwaggerParser.validate(fullPath, {continueOnError:true, validate:{spec: false}});
13+
const SwaggerParser = require("@apidevtools/swagger-parser")
14+
let api = await SwaggerParser.validate(fullPath, {continueOnError:true})
1515
console.log("API specification is valid ")
1616
}
1717
catch(err) {

0 commit comments

Comments
 (0)