name: version-parse
description: "Parse a semantic version."
inputs:
  version:
    description: "The version to parse."
    required: true
outputs:
  version:
    description: "The version of the package."
    value: ${{ steps.parse.outputs.version }}
  major:
    description: "The major version of the package."
    value: ${{ steps.parse.outputs.major }}
  minor:
    description: "The minor version of the package."
    value: ${{ steps.parse.outputs.minor }}
  patch:
    description: "The patch version of the package."
    value: ${{ steps.parse.outputs.patch }}
  revision:
    description: "The patch revision version of the package. The suffix treated as a number seperated by a '.'"
    value: ${{ steps.parse.outputs.revision }}
  metadata:
    description: "The of the package."
    value: ${{ steps.parse.outputs.metadata }}
  suffix:
    description: "The suffix of the package."
    value: ${{ steps.parse.outputs.suffix }}
  isPrerelease:
    description: "Whether or not the package is a prerelease package."
    value: ${{ steps.parse.outputs.isPrerelease }}
runs:
  using: "composite"
  steps:
  - name: "Parse version."
    id: parse
    run: bash ${{ github.action_path }}/parse_version.sh "${{ inputs.version }}"
    shell: bash