Shared, reusable GitHub Actions workflows for clementrog's Node/TypeScript repos.
A reusable workflow (workflow_call)
that runs PR checks. The contract is standardized; the command is not.
Every caller repo must expose an npm run ci:pr script. This workflow only does:
npm ci
npm run ci:prEach repo decides what ci:pr means (typecheck + its own meaningful test subset). Don't
hard-code one universal test command across repos — that's fake safety.
Add .github/workflows/pr-ci.yml to a repo:
name: PR CI
on:
pull_request:
branches: [main]
jobs:
ci:
uses: clementrog/github-workflows/.github/workflows/node-pr-ci.yml@v1
with:
node-version: "20.19.0" # optional; default 20.19.0Then define the contract in that repo's package.json:
{
"scripts": {
"ci:typecheck": "tsc --noEmit",
"ci:test:focused": "vitest --run",
"ci:pr": "npm run ci:typecheck && npm run ci:test:focused"
}
}The resulting check appears as ci / ci (caller job → reusable job). Make it required
on main after it has run green at least once. Avoid paths: filters on a required
check — skipped required checks leave PRs stuck pending.
| input | default | description |
|---|---|---|
node-version |
20.19.0 |
passed to actions/setup-node |
runs-on |
ubuntu-latest |
runner label |
Pin callers to a tag (@v1) or SHA rather than @main, so a change to the recipe can't
silently alter every repo's CI at once.