generate-bom/action.yml

54 lines
1.5 KiB
YAML

name: "Generate BOM"
description: >
Generate a BOM for the project using py-allspice and attach it as an artifact
to the run.
Works for Altium and OrCAD projects.
inputs:
source_path:
description: >
Path to the source file from the root of the repo. For Altium projects,
this should be the path to the .PrjPcb file. For OrCAD projects, this
should be the path to the .dsn file.
required: true
output_file_name:
description: "Name of the output file"
required: true
default: "bom.csv"
columns:
description: >
A path to a JSON file mapping columns to the attributes they are from.
required: true
group_by:
description: >
A comma-separated list of columns to group the BOM by. If not present, the
BOM will be flat.
default: ""
variant:
description: >
The variant of the project to generate the BOM for. If not present, the
BOM will be generated for the default variant. Not supported for OrCAD
projects.
default: ""
runs:
using: "docker"
image: "Dockerfile"
args:
- "--source_ref"
- ${{ github.sha }}
- "--allspice_hub_url"
- ${{ github.server_url }}
- "--columns"
- ${{ inputs.columns }}
- "--group_by"
- ${{ inputs.group_by }}
- "--variant"
- ${{ inputs.variant }}
- "--output_file"
- "${{ github.workspace}}/${{ inputs.output_file_name }}"
- ${{ github.repository }}
- ${{ inputs.source_path }}
env:
ALLSPICE_AUTH_TOKEN: ${{ github.token }}