Skip to content
check-square

GitHub Action

Get OpenAPI updated package version

v1.0.2 Latest version

Get OpenAPI updated package version

check-square

Get OpenAPI updated package version

A GitHub Action for getting appropriate updated semver OpenAPI package version

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Get OpenAPI updated package version

uses: swimmwatch/[email protected]

Learn more about this action in swimmwatch/openapi-diff-semver-bump

Choose a version

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/[email protected]
  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.