name: 'Helm Publisher'
description: 'A GitHub Action for publishing Helm charts with Github Pages'
author: 'Stefan Prodan'
branding:
  icon: 'command'
  color: 'blue'
inputs:
  token:
    description: "GitHub token"
    required: true
  charts_dir:
    description: "The charts directory, defaults to `charts`"
    required: false
  charts_url:
    description: "The GitHub Pages URL, defaults to `https://<OWNER>.github.io/<REPOSITORY>`"
    required: false
  owner:
    description: "The GitHub user or org that owns this repository, defaults to `GITHUB_REPOSITORY`"
    required: false
  repository:
    description: "The GitHub repository name, defaults to `GITHUB_REPOSITORY`"
    required: false
  branch:
    description: "The branch to publish charts, defaults to `gh-pages`"
    required: false
  target_dir:
    description: "The target directory to store the charts, defaults to `.`"
    required: false
  helm_version:
    description: "The Helm CLI version"
    required: false
  linting:
    description: "Toggle Helm linting, can be disabled by setting it to 'off'"
    required: false
  commit_username:
    description: "The user name used for the commit user"
    required: false
    default: ${{ github.actor }}
  commit_email:
    description: "The email used for the commit user"
    required: false
    default: ${{ github.actor }}@users.noreply.github.com
  app_version:
    description: "Set the appVersion on the chart to this version"
    required: false
  chart_version:
    description: "Set the version on the chart to this version"
    required: false
  index_dir:
    description: "The location of `index.yaml` file in the repo, defaults to the same value as `target_dir`"
    required: false
  enterprise_url:
    description: "The URL of enterprise github server in the format '<server-url>/<organisation>'"
    required: false
  dependencies:
    description: "A list of helm repositories required to verify dependencies in the format '<name>,<url>;<name>,<url>'"
    required: false
  repo_url:
    description: "The URL of the git repository"
    required: false
  ssh_private_key:
    description: "SSH private key for ssh connection to the target repository"
    required: false
runs:
  using: 'docker'
  image: 'Dockerfile'
  args:
    - ${{ inputs.token }}
    - ${{ inputs.charts_dir }}
    - ${{ inputs.charts_url }}
    - ${{ inputs.owner }}
    - ${{ inputs.repository }}
    - ${{ inputs.branch }}
    - ${{ inputs.target_dir }}
    - ${{ inputs.helm_version }}
    - ${{ inputs.linting }}
    - ${{ inputs.commit_username }}
    - ${{ inputs.commit_email }}
    - ${{ inputs.app_version }}
    - ${{ inputs.chart_version }}
    - ${{ inputs.index_dir }}
    - ${{ inputs.enterprise_url }}
    - ${{ inputs.dependencies }}
    - ${{ inputs.repo_url }}
    - ${{ inputs.ssh_private_key }}