ContextLevy is a Node.js project with a dual build: a bundled GitHub Action and a published npm CLI.
Install dependencies:
npm installRun tests:
npm testRun Biome, typecheck, tests, and Fallow dead-code checks:
npm run checkRun the full check suite plus build:
npm run allRun dead-code analysis with Fallow:
npm run check:fallowFallow config lives in .fallowrc.json. It declares Action and CLI entry points, ignores dogfood fixtures under examples/, and treats GitHub Action build dependencies as used.
Build the action bundle and CLI:
npm run build # both
npm run build:action # GitHub Action only → dist/index.js
npm run build:cli # local CLI only → lib/Commit dist/index.js after building the action so workflow consumers do not need to install runtime dependencies. The CLI (lib/) is built automatically on npm publish via prepack.
Verify the npm tarball before publishing:
npm run pack:checkSee ARCHITECTURE.md for the module map, dependency rules, and where to add new features.
Releases are automated when a version bump lands on main. The release workflow detects a package.json version change, runs tests, verifies dist/, creates a GitHub Release, pushes the semver tag, publishes the CLI to npm via trusted publishing (OIDC), and updates the major tag.
Do not push semver tags manually. Bump the version in package.json, package-lock.json, and CHANGELOG.md, push to main, and CI handles the tag, GitHub Release, and npm publish.
On npmjs.com → Package settings → Trusted publishing, configure GitHub Actions with repository nonlooped/contextlevy and workflow filename release.yml. No NPM_TOKEN secret is required.
If npm publish fails after a version bump, re-run the Release workflow from the Actions tab (workflow_dispatch) once the package is missing on npm — it will retry without another version bump.
Example release sequence:
# After updating package.json, package-lock.json, and CHANGELOG.md
git push origin mainThe workflow updates the major-version tag (v2) automatically.
Before trusted publishing is configured, publish the CLI once from a clean checkout:
npm ci
npm run pack:check
npm publish --access publicThen add the trusted publisher on npmjs.com as described above. Later version bumps on main publish automatically via OIDC.
Consumers should usually pin:
- uses: nonlooped/contextlevy@v2For maximum supply-chain safety, consumers can pin a full commit SHA.