Skip to content

Latest commit

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

github-workflows

Shared, reusable GitHub Actions workflows for clementrog's Node/TypeScript repos.

node-pr-ci.yml — PR CI contract

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:pr

Each 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.

Use it

Add .github/workflows/pr-ci.yml to a repo:

name: PR CIon:
pull_request:
branches: [main]jobs:
ci:
uses: clementrog/github-workflows/.github/workflows/node-pr-ci.yml@v1with:
node-version: "20.19.0"# optional; default 20.19.0

Then 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 mainafter it has run green at least once. Avoid paths: filters on a required check — skipped required checks leave PRs stuck pending.

Inputs

inputdefaultdescription
node-version20.19.0passed to actions/setup-node
runs-onubuntu-latestrunner label

Versioning

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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors