name: Generate gas diff
author: TomAFrench
description: Easily compare circuit size reports generated by Nargo!
branding:
  icon: info
  color: purple

inputs:
  token:
    description: The repository's github token.
    default: ${{ github.token }}
    required: false
  base:
    description: The gates diff reference branch name.
    default: ${{ github.base_ref || github.ref_name }}
    required: false
  head:
    description: The gates diff target branch name.
    default: ${{ github.head_ref || github.ref_name }}
    required: false
  report:
    description: Report freshly generated to compare to reference.
    default: gatesreport.json
    required: false
  header:
    description: The top section displayed in the markdown output.
    default: |
      # Changes to circuit sizes
    required: false
  summaryQuantile:
    description: The quantile threshold to filter avg gas cost diffs to display in the summary top section.
    default: 0.8
    required: false
  # sortCriteria:
  #   description: The list of criteria to order diff rows by in the report (name | min | avg | median | max | calls), separated by a comma. Must have the same length as sortOrders.
  #   required: false
  #   default: name
  # sortOrders:
  #   description: The list of directions to order diff rows in the report, according to order criteria (asc | desc), separated by a comma. Must have the same length as sortCriteria.
  #   required: false
  #   default: asc
  # ignore:
  #   description: The list of contract paths from which to ignore gates reports, separated by a comma.
  #   required: false
  # match:
  #   description: The list of contract paths of which only to keep gates reports, separated by a comma.
  #   required: false

outputs:
  shell:
    description: The gates diff between the base gates report and the freshly generated gates report, specifically formatted for shell display
  markdown:
    description: The gates diff between the base gates report and the freshly generated gates report, specifically formatted for markdown display

runs:
  using: node16
  main: dist/index.js
