Skip to main content

Composite Action: Batho Index

The composite action (action.yml) is a self-contained GitHub Action that sets up Batho, indexes your repository, and uploads the transport artifact. It can be invoked directly from any workflow.

How It Works​

Inputs​

InputTypeRequiredDefaultDescription
rootstringNo.Path to the repo root to index (relative to GITHUB_WORKSPACE).
python-versionstringNo3.12Python version to install via uv.
batho-refstringNo""How to install Batho:
- "" — from the action's own checkout
- git ref — "git+https://github.com/sageoz/batho@<ref>"
- "pypi" — install from PyPI via pip install batho
verbosestringNofalseRun Batho in verbose/debug mode (true or false).
max-workersstringNo""Max parallel workers for parsing (default: CPU count).
max-file-size-kbstringNo""Skip files exceeding this size in kilobytes.
artifact-namestringNobatho-indexName of the uploaded workflow artifact.
artifact-retention-daysstringNo7How long (in days) to retain the uploaded artifact.
upload-artifactstringNotrueUpload the output ZIP as a workflow artifact (true or false).
summarystringNotrueWrite a GitHub Step Summary (true or false).

Outputs​

OutputDescription
zip-pathAbsolute path to the produced .batho ZIP package.
output-dirAbsolute path to the directory containing the ZIP package.
index-idThe Batho index run ID produced by this build.

Usage Example​

name: Index Repository

on:
push:
branches: [main]

jobs:
batho:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Run Batho Index
uses: sageoz/batho@v1.1.0
with:
root: "."
python-version: "3.12"
batho-ref: "pypi"
verbose: "false"
artifact-name: batho-index
artifact-retention-days: "7"
upload-artifact: "true"
summary: "true"

- name: Use output path
run: |
echo "Batho artifact: ${{ steps.batho.outputs.zip-path }}"
echo "Index ID: ${{ steps.batho.outputs.index-id }}"

Installation Modes​

Mode 1: From Action Checkout (default)​

Leave batho-ref empty. The action installs Batho from its own checkout using uv pip install:

with:
batho-ref: ""

Mode 2: From PyPI​

Set batho-ref to "pypi" to install the latest published version:

with:
batho-ref: "pypi"

Mode 3: From Git Ref​

Pin a specific commit, tag, or branch:

with:
batho-ref: "v1.1.0"

Step Summary​

When summary: "true", the action writes a markdown summary to the GitHub Step Summary panel:

MetricValue
Files indexed1,247
Entities extracted8,932
Relationships24,105
Transport ZIPartifact_repo.batho
ZIP Size4.2 MiB

This is useful for quickly verifying index health in the Actions UI without downloading artifacts.