name: 'Run KiBot'
description: 'Run KiBot automation to generate images and gerbers'
inputs:
  boards:
    description: 'KiCad PCB names'
    required: true
  config:
    description: 'KiBot config file'
    required: true
runs:
  using: 'docker'
  image: 'docker://ghcr.io/inti-cmnb/kicad7_auto:latest'
  entrypoint: '/bin/bash'
  args:
    - '-c'
    # GH actions set $HOME to a weird location and we have to move Kicad settings there first
    - |
      for board in ${{ inputs.boards }};
      do
        echo Processing $board;
        kibot -b $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}.kicad_pcb -c $GITHUB_WORKSPACE/kibot/${{ inputs.config }}.kibot.yaml
      done