name: github-query-nuget-versions-latest
description: "Get the latest version of a NuGet package."
inputs:
  url:
    description: "Url of the GitHub server instance."
    required: true
    default: ${{ github.server_url }}
  organization:
    description: "Organization to search."
    required: true
    default: ${{ github.repository_owner }}
  apiToken:
    description: "Api Token for GitHub."
    required: true
    default: ${{ github.token }}
  prerelease:
    description: "Show prerelease packages. Values: true, false."
    required: false
    default: "false"
  name:
    description: "Name of a specific package."
    required: true
  filter:
    description: "String to filter by."
    required: false
  filterIsExpression:
    description: "Is the first filter a Regular Expression? Values: true, false."
    required: false
    default: "false"
  additionalArgs:
    description: "Additional arguments to pass into curl."
    required: false
outputs:
  version:
    description: "The latest version of the specified package."
    value: ${{ steps.parse.outputs.version }}
runs:
  using: "composite"
  steps:
  - name: "Get versions."
    id: versions
    uses: act/common/github/github-query-nuget-versions@master
    with:
      url: ${{ inputs.url }}
      organization: ${{ inputs.organization }}
      apiToken: ${{ inputs.apiToken }}
      prerelease: ${{ inputs.prerelease }}
      name: ${{ inputs.name }}
      additionalArgs: ${{ inputs.additionalArgs }}
  - name: "Parse query result."
    id: parse
    uses: act/common/utils/get-latest-version@master
    with:
      versions: ${{ steps.versions.outputs.versions }}
      filter: ${{ inputs.filter }}
      filterIsExpression: ${{ inputs.filterIsExpression }}