$ recombobulate _
home / tips / create-github-reusable-workflows-to-share-ci-logic-across-repos
0

Create GitHub Reusable Workflows to Share CI Logic Across Repos

bagwaa @bagwaa · Mar 26, 2026 · Workflows
create-github-reusable-workflows-to-share-ci-logic-across-repos

Once you have multiple repos running similar CI steps, extract them into a reusable workflow — a fix in one place fixes all of them. Ask Claude to write the callable workflow and the caller stub.

# Prompt:
# "Create a GitHub reusable workflow for PHP projects stored in .github/workflows/php-ci.yml:
# - Inputs: php-version (default '8.3'), run-coverage (bool, default false)
# - Jobs: lint (Pint), static analysis (PHPStan level 9), tests (Pest)
# - Cache Composer dependencies keyed by composer.lock hash
# - Upload coverage to Codecov if run-coverage is true
# - Output test-outcome (pass/fail) for caller workflows to branch on
# Also write the caller workflow that another repo would use."

The tricky part of reusable workflows is inputs vs secrets scoping — Claude gets this right and comments why each value is an input versus a secret that needs explicit inheritance.

The resulting caller is clean and minimal:

jobs:
  ci:
    uses: my-org/.github/.github/workflows/php-ci.yml@main
    with:
      php-version: '8.3'
      run-coverage: true
    secrets: inherit

Claude also handles the edge cases: workflow_call trigger syntax, making outputs available across jobs, and ensuring the cache key invalidates correctly when composer.lock changes.

Copying CI YAML between repos is tech debt waiting to happen — one reusable workflow fixes every repo at once.

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Scan Pending Changes for Security Issues with /security-review

The /security-review command scans your uncommitted changes for injection vectors, auth gaps, hardcoded secrets, and other common vulnerabilities.

bagwaa @bagwaa · 1 hour ago
0
Run Setup Scripts on Every Session with the SessionStart Hook

The SessionStart hook fires when any session begins or resumes, making it ideal for loading environment variables and running one-time setup scripts.

bagwaa @bagwaa · 1 hour ago
0
Write Property-Based Tests with fast-check and Claude

Ask Claude to write property-based tests for your functions using fast-check — it identifies the mathematical invariants in your code and generates tests that cover inputs you'd never enumerate by hand.

bagwaa @bagwaa · 2 hours ago