---
name: Python Semantic Release

description: Automated Releases via SemVer and Commit Message Conventions

branding:
  color: orange

inputs:

  config_file:
    default: ""
    required: false
    description: |
      Path to a custom semantic-release configuration file. By default, an empty
      string will look for a pyproject.toml file in the current directory. This is the same
      as passing the `-c` or `--config` parameter to semantic-release.

  directory:
    default: "."
    required: false
    description: Sub-directory to cd into before running semantic-release

  github_token:
    required: true
    description: GitHub token used to push release notes and new commits/tags

  git_committer_name:
    required: false
    description: The human name for the “committer” field

  git_committer_email:
    required: false
    description: The email address for the “committer” field

  no_operation_mode:
    default: "false"
    required: false
    description: |
      If set to true, the github action will pass the `--noop` parameter to
      semantic-release. This will cause semantic-release to run in "no operation"
      mode. See the documentation for more information on this parameter. Note that,
      this parameter will not affect the output of the action, so you will still get
      the version determination decision as output values.

  ssh_public_signing_key:
    required: false
    description: The ssh public key used to sign commits

  ssh_private_signing_key:
    required: false
    description: The ssh private key used to sign commits

  strict:
    default: "false"
    required: false
    description: |
      If set to true, the github action will pass the `--strict` parameter to
      semantic-release. See the documentation for more information on this parameter.

  verbosity:
    default: "1"
    required: false
    description: |
      Set the verbosity level of the output as the number of -v's to pass to
      semantic-release. 0 is no extra output, 1 is info level output, 2 is
      debug output, and 3 is silly debug level of output.

  # `semantic-release version` command line options
  prerelease:
    required: false
    description: |
      Force the next version to be a prerelease. Set to "true" or "false".

  prerelease_token:
    required: false
    description: "Force the next version to use this prerelease token, if it is a prerelease"

  force:
    required: false
    description: |
      Force the next version to be a major release. Must be set to
      one of "prerelease", "patch", "minor", or "major".

  commit:
    required: false
    description: Whether or not to commit changes locally. Defaults are handled
      by python-semantic-release internal version command.

  tag:
    required: false
    description: |
      Whether or not to make a local version tag. Defaults are handled
      by python-semantic-release internal version command.

  push:
    required: false
    description: |
      Whether or not to push local commits to the Git repository. See
      the configuration page for defaults of `semantic-release version`
      for how the default is determined between push, tag, & commit.

  changelog:
    required: false
    description: |
      Whether or not to update the changelog.

  vcs_release:
    required: false
    description: |
      Whether or not to create a release in the remote VCS, if supported

  build:
    required: false
    description: |
      Whether or not to run the build_command for the project. Defaults are
      handled by python-semantic-release internal version command.

  build_metadata:
    required: false
    description: |
      Build metadata to append to the new version

outputs:
  commit_sha:
    description: |
      The commit SHA of the release if a release was made, otherwise an empty string

  is_prerelease:
    description: |
      "true" if the version is a prerelease, "false" otherwise

  link:
    description: |
      The link to the release in the remote VCS, if a release was made. If no release was made,
      this will be an empty string.

  previous_version:
    description: |
      The previous version before the release, if a release was or will be made. If no release is detected,
      this will be the current version or an empty string if no previous version exists.

  released:
    description: |
      "true" if a release was made, "false" otherwise

  release_notes:
    description: |
      The release notes generated by the release, if any. If no release was made,
      this will be an empty string.

  tag:
    description: |
      The Git tag corresponding to the version output

  version:
    description: |
      The newly released version if one was made, otherwise the current version

runs:
  using: docker
  image: src/gh_action/Dockerfile
