Skip to content

stelzo/openapi-api-version-print

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAPI API Version Print

Prints the version of an API saved inside a OpenAPI Specification in yaml or json.

Usage

name: My Workflow
on: [push, pull_request]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Get API Version
      
      uses: stelzo/openapi-api-version-print@v1
      with:
        specFile: swagger.json

Inputs

Input Description
specFile (optional) Path to the OpenAPI Specification file (local or URI). If not given, it looks up openapi.yaml, openapi.yml and openapi.json in the current directory.

Outputs

Output Description
apiVersion The API version in the OpenAPI Specification file.

Example

Local

steps:
- uses: actions/checkout@v3
- name: Get API Version from local file
  
  # id is used to reference the output
  id: api-version-print

  # Run the action
  uses: stelzo/openapi-api-version-print@v1
  with:
    specFile: swagger.json

# Somewhere else in the workflow
- name: Check API Version
  run: |
    echo "Version - ${{ steps.api-version-print.outputs.apiVersion }}"

Remote

  uses: stelzo/openapi-api-version-print@v1
  with:
    specFile: https://raw.githubusercontent.com/dofusdude/api-docs/main/openapi-3.0.yaml

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published