Skip to main content

Reusable Workflow

The reusable workflow (batho-index.yml) wraps the composite action into a callable workflow. Consumer repositories can invoke it in a single line, with no need to manage steps manually.

How It Works​

Calling Syntax​

Add this to any workflow in a consumer repository:

jobs:
batho:
uses: sageoz/batho/.github/workflows/batho-index.yml@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"
runs-on: "ubuntu-latest"

Inputs​

The reusable workflow accepts all inputs from the composite action, plus one extra:

InputTypeRequiredDefaultDescription
rootstringNo.Path to the repo root to index.
python-versionstringNo3.12Python version to install.
batho-refstringNo""Git ref of Batho to install, or empty for action checkout.
verbosestringNofalseRun in verbose mode.
max-workersstringNo""Max parallel workers for parsing.
max-file-size-kbstringNo""Skip files exceeding this size.
artifact-namestringNobatho-indexName of the uploaded artifact.
artifact-retention-daysstringNo7Artifact retention in days.
upload-artifactstringNotrueUpload the output ZIP.
summarystringNotrueWrite a GitHub Step Summary.
runs-onstringNoubuntu-latestRunner label for the job.

Outputs​

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

Complete Consumer Example​

name: Batho Index

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
batho:
uses: sageoz/batho/.github/workflows/batho-index.yml@v1.1.0
with:
root: "."
python-version: "3.12"
batho-ref: "pypi"
artifact-name: batho-index
artifact-retention-days: "7"

Permissions​

The reusable workflow declares:

permissions:
contents: read

Consumer workflows only need contents: read to check out the repository. The composite action handles artifact upload internally.

Why Use the Reusable Workflow?​

  • One-liner integration: No step definitions needed.
  • Always up to date: Pin to a tag (v1.1.0) or follow main for latest features.
  • Centralized defaults: Batho maintainers can update defaults without touching consumer repos.