Skip to content

A GitHub Action for getting appropriate updated SemVer OpenAPI package version.

License

Notifications You must be signed in to change notification settings

swimmwatch/openapi-diff-semver-bump

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

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openapi-diff-semver-bump

A GitHub Action for getting appropriate updated SemVer OpenAPI package version.

Usage

The following example workflow steps will generate a new version by previous tag and updated state from OpenAPITools/openapi-diff.

- name: "Find difference between OpenAPI specifications"
  id: diff_state
  uses: swimmwatch/openapi-diff-action@v1.0.2
  with:
    old-spec: "old_spec.json"
    new-spec: "new_spec.json"
- name: "Get previous tag"
  id: previous_tag
  uses: WyriHaximus/github-action-get-previous-tag@v1
  env:
    GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: "Get appropriate new package version"
  id: updated_version
  uses: swimmwatch/openapi-diff-semver-bump@v1
  with:
    package-version: ${{steps.previous_tag.outputs.tag}}
    updated-state: ${{steps.diff_state.outputs.state}}

Options

The following input variables options can/must be configured:

Input variable Necessity Description Default
package-version Required Package SemVer version
updated-state Required Output state from OpenAPITools/openapi-diff: no_changes, incompatible, compatible

Outputs

  • new-package-version: New package SemVer version e.g. 1.2.3.

License

openapi-diff-semver-bump is licensed under the MIT License.