bom_diff/README.md
2025-06-11 10:14:03 -05:00

57 lines
1.6 KiB
Markdown

# 🧾 BOM Diff Generator Action
A GitHub Action that compares two Bill of Materials (BOM) CSV files and generates a diff report in CSV format.
Includes support for flexible column mapping using a YAML config, and sorts the output by quantity change priority.
---
## ✨ Features
- ✅ Detects part additions, removals, and quantity changes
- 🛠 Customizable column mapping (`columns.yml`)
- 🔃 Output sorted by `adjusted_quantity` (positives first, zeros last)
- 🧠 Ignores specified part number patterns (e.g., testpoints, fiducials)
- 🧩 Simple to integrate into GitHub Actions workflows
---
## 📦 Inputs
| Name | Description | Required |
|----------------|------------------------------------------|----------|
| `bom_old` | Path to the original BOM CSV file | ✅ |
| `bom_new` | Path to the updated BOM CSV file | ✅ |
| `column_file` | Path to the YAML file describing columns | ✅ |
| `out_file` | Path where diff CSV will be saved | ✅ |
---
## 🧪 Example Workflow
```yaml
name: BOM Diff
on:
push:
paths:
- 'bom_test_old.csv'
- 'bom_test_new.csv'
- 'columns.yml'
jobs:
compare:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run BOM Diff Action
uses: ./ # Use relative path or replace with repo slug
with:
bom_old: bom_test_old.csv
bom_new: bom_test_new.csv
column_file: columns.yml
out_file: test_diff.csv
- name: Print Diff Output
run: cat test_diff.csv