Skip to content

Reusable workflow: format / lint / typecheck preflight #7

@mabry1985

Description

@mabry1985

Why

Most of our internal repos (protoMaker, protoCLI, mythxengine, rabbit-hole.io, …) have a near-identical checks.yml workflow that runs the same three steps:

  1. npm run format:check (Prettier)
  2. npm run lint (ESLint)
  3. npm run typecheck (tsc)

Every repo maintains its own copy. They drift — different action versions, different node setups, different cache strategies, different runner labels.

What

Add a reusable workflow (workflow_call) to release-tools that any repo can call:

# in <consumer-repo>/.github/workflows/checks.yml
name: Checks
on: [pull_request, push]
jobs:
  preflight:
    uses: protoLabsAI/release-tools/.github/workflows/preflight.yml@v1
    with:
      node-version: '22'
      # optional: skip individual steps
      run-format: true
      run-lint: true
      run-typecheck: true

Defaults should target namespace-profile-protolabs-linux so every consumer also gets the right runner choice for free.

Inputs (draft)

Input Default Notes
node-version '22' passed to actions/setup-node
run-format true npm run format:check
run-lint true npm run lint
run-typecheck true npm run typecheck
working-directory . for monorepos with a non-root setup
install-command 'npm ci' override for pnpm/bun

Out of scope

  • Build / test runs — those vary too much per repo. Separate workflow later if there's a pattern.

Reference

Currently most repos have a hand-rolled version of this. Example: protoMaker checks.yml.

Filed off the back of protoMaker#3650, which finished the release-notes consolidation. The "Pre-flight" pattern is the next biggest duplication.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions