From 5295a196d6b1bc7b9a12c7da14db5ba78e513131 Mon Sep 17 00:00:00 2001 From: vaibhav-jain Date: Tue, 31 Mar 2020 20:00:26 +0530 Subject: [PATCH] Use spectral instead of swagger-cli --- Dockerfile | 2 +- action.yaml | 6 +++--- entrypoint.sh | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 28bd17a..6136136 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM mhart/alpine-node:12 -RUN npm install -g @apidevtools/swagger-cli +RUN npm install -g @stoplight/spectral COPY entrypoint.sh /usr/local/bin/ diff --git a/action.yaml b/action.yaml index a6fc82a..3f99156 100644 --- a/action.yaml +++ b/action.yaml @@ -1,11 +1,11 @@ name: 'Swagger cli action' description: 'Run Swagger validation on your OAS JSON or YAML file. Supports Swagger 2.0 or OpenAPI 3.0 format' inputs: - file_path: - description: 'Path to OAS file for validation' + args: + description: 'Arguments. Use --help to see the complete list of supported args' required: true runs: using: 'docker' image: 'Dockerfile' args: - - ${{ inputs.file_path }} + - ${{ inputs.args }} diff --git a/entrypoint.sh b/entrypoint.sh index cc2e28a..2eb7df2 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,4 +4,4 @@ echo "======================" echo "= Linting OAS file =" echo "======================" -cd /github/workspace/ && swagger-cli validate "$INPUT_FILE_PATH" +cd /github/workspace/ && spectral lint "$INPUT_ARGS"