cofactr-cogs/action.yml

70 lines
2.1 KiB
YAML

name: "Generate COGS using Cofactr"
description: >
Generate cost of goods sold (COGS) using Cofactr.
inputs:
bom_file:
description: "Path to the BOM CSV file"
required: true
quantities:
description: >
A comma-separated list of quantities of PCBs to compute the COGS for. E.g.
1,10,100,1000. Defaults to the example.
default: "1,10,100,1000"
bom_part_number_column:
description: >
The name of the part number column in the BOM file. You must provide
this.
default: ''
bom_manufacturer_column:
description: >
The name of the manufacturer column in the BOM file. Defaults to ''. If
you use a search strategy that uses manufacturer, you must provide this.
default: ''
bom_quantity_column:
description: >
The name of the quantity column in the BOM file. You must provide this.
default: ''
search_strategy:
description: >
The Cofactr search strategy. Can be: "mpn_sku_mfr" or "fuzzy" (uses mpn).
Defaults to "mpn_sku_mfr". See Cofactr API documentation for more
information on search strategies.
default: mpn_sku_mfr
output_file:
description: >
The path to the output file. Defaults to stdout, i.e. printing to the
console.
default: ''
api_key:
description: "Cofactr API Key"
required: true
client_id:
description: "Cofactr Client ID"
required: true
log_level:
description: Set log level for debugging
default: info
runs:
using: "docker"
image: "Dockerfile"
args:
- "--quantities"
- "${{ inputs.quantities }}"
- "--bom-part-number-column"
- ${{ inputs.bom_part_number_column }}
- "--bom-manufacturer-column"
- ${{ inputs.bom_manufacturer_column }}
- "--bom-quantity-column"
- ${{ inputs.bom_quantity_column }}
- "--search-strategy"
- ${{ inputs.search_strategy }}
- "--output-file"
- ${{ inputs.output_file }}
- "--log-level"
- ${{ inputs.log_level }}
- ${{ inputs.bom_file }}
env:
ALLSPICE_AUTH_TOKEN: ${{ github.token }}
COFACTR_API_KEY: ${{ inputs.api_key }}
COFACTR_CLIENT_ID: ${{ inputs.client_id }}