On this page
Monorepo sync command and helpers: trigger rewriting, working-directory injection, router workflow generation, and tag prefix configuration.
#rlsbl.commands.monorepo.sync
#rlsbl.commands.monorepo.sync
Monorepo sync command and all sync helpers: trigger rewriting, working-directory injection, router generation.
#_rewrite_trigger
def _rewrite_trigger(content)Replace the on: trigger block with workflow_call.
Handles both multi-line triggers (on: alone on a line, with indented sub-keys up to jobs:) and single-line triggers (on: push, on: [push, ...]).
#_inject_working_directory
def _inject_working_directory(content, path)Insert a defaults.run.working-directory block before the jobs: line.
#_rewrite_version_file_inputs
def _rewrite_version_file_inputs(content, project_path)Prepend project_path to known *-version-file action inputs.
Actions like actions/setup-go resolve go-version-file relative to the repo root, not working-directory. When a workflow is copied into a monorepo sub-project we must adjust these inputs so the runner can still find the file.
Known inputs: go-version-file, python-version-file, node-version-file.
#_inject_packages_dir
def _inject_packages_dir(content, project_path)Add packages-dir to pypa/gh-action-pypi-publish steps.
When working-directory is set, uv build creates artifacts in {project_path}/dist/ but the publish action looks for dist/ at the repo root. We inject packages-dir so it finds the right directory.
Step lines in YAML workflows look like - uses: action@v1 (list item syntax). The with: block is indented relative to the - uses: marker -- specifically at the same column as uses:.
#_generate_router
def _generate_router(projects)Generate ci-router.yml content from project list.
#_get_monorepo_tag_prefix
def _get_monorepo_tag_prefix(project, root)Return the tag prefix for a monorepo project's publish router condition.
Uses the target's monorepo_tag_glob to derive the prefix (glob minus trailing *). For Go projects this yields go/v, for others name@v.