Skip to content

Latest commit

 

History

History
75 lines (50 loc) · 1.67 KB

File metadata and controls

75 lines (50 loc) · 1.67 KB

Contributing

Setup

  1. Install Node.js 24 or newer.
  2. Install dependencies:
npm ci

If you are bootstrapping from scratch and no lockfile exists yet, run npm install once, then commit the generated package-lock.json.

Build

Compile TypeScript:

npm run build

Bundle the action dist/ entrypoints for GitHub Actions:

npm run bundle

That command produces:

  • dist/index.cjs for the main action
  • dist/post/index.cjs for the post-step cache save

The generated dist/ files must be committed, because GitHub Actions consumers run the checked-in dist/ output directly.

Test

Run the unit tests:

npm test

This runs the TypeScript tests directly with Vitest.

Validate

Run the action repo checks locally:

npm test
npm run bundle
git diff --stat

git diff should only show the source and generated dist/ changes you intend to release.

Release

  1. Make the source changes.
  2. Run npm ci.
  3. Run npm test.
  4. Run npm run bundle.
  5. Commit both source files and the generated dist/ output.
  6. Push the commit to main.
  7. Open the Release workflow in GitHub Actions and run it manually with the desired version, for example v1.2.0 or 1.2.0.
  8. The workflow re-runs validation, creates the GitHub Release with generated notes, and creates the corresponding Git tag from the current main commit.
  9. For stable semver tags, the workflow also moves the matching major tag such as v1.

You do not need to create or push the version tag manually; the workflow does that via GitHub when it creates the release.

Consumers should normally reference the major tag:

- uses: j178/prek-action@v1