name: 'Pull Request Stats'
author: 'Manuel de la Torre'
description: 'Github action to print relevant stats about Pull Request reviewers'
inputs:
  token:
    description: 'An optional Personal Access Token with enough permissions to fetch all required pull requests to calculate the stats.'
    required: false
  githubToken:
    description: 'The default GitHub Token (secrets.GITHUB_TOKEN), used to publish comments as a bot. No need to assign a value for this input.'
    required: true
    default: ${{ github.token }}
  repositories:
    description: 'A comma separated list of github repositories to calculate the stats.'
    required: false
  organization:
    description: 'An organization name to use all of its repositories to calculate the stats.'
    required: false
  period:
    description: 'The length of the period used to calculate the stats, expressed in days'
    required: false
    default: 30
  limit:
    description: 'The maximum number of rows to display in the table. A value of `0` means unlimited.'
    required: false
    default: 0
  charts:
    description: 'Whether to add charts to the stats or not. Possible values: "true" or "false"'
    required: false
    default: 'false'
  sortBy:
    description: 'The column used to sort the data. Possible values: "REVIEWS", "TIME" or "COMMENTS"'
    required: false
    default: 'REVIEWS'
  publishAs:
    description: 'Where to publish the results. Possible values: "COMMENT", "DESCRIPTION" or "NONE"'
    required: false
    default: 'COMMENT'
  disableLinks:
    description: 'Prevents from adding any external links in the stats'
    required: false
    default: false
  telemetry:
    description: 'Indicates if the action is allowed to send monitoring data to the developer.'
    required: false
    default: true
  slackWebhook:
    description: 'A Slack webhook URL to post resulting stats.'
    required: false
  slackChannel:
    description: 'The Slack channel where stats will be posted. Required when a Slack webhook is configured.'
    required: false
  teamsWebhook:
    description: 'A Microsoft Teams webhook URL to post resulting stats.'
    required: false
  webhook:
    description: 'A webhook URL to post resulting stats.'
    required: false
  sort-by:
    description: 'Used for retro compatibility. Use "sortBy" input instead.'
    required: false
  publish-as:
    description: 'Used for retro compatibility. Use "publishAs" input instead.'
    required: false
  disable-links:
    description: 'Used for retro compatibility. Use "disableLinks" input instead.'
    required: false
    default: false
  slack-webhook:
    description: 'Used for retro compatibility. Use "slackWebhook" input instead.'
    required: false
  slack-channel:
    description: 'Used for retro compatibility. Use "slackChannel" input instead.'
    required: false
  teams-webhook:
    description: 'Used for retro compatibility. Use "teamsWebhook" input instead.'
    required: false
outputs:
  resultsMd:
    description: 'The resulting stats stored as a step output variable in Markdown format.'
  resultsJson:
    description: 'The resulting stats stored as a step output variable in JSON format.'
runs:
  using: node20
  main: 'dist/index.js'
branding:
  icon: 'award'
  color: 'yellow'
