Skip to content

Latest commit

 

History

History
192 lines (124 loc) · 5.73 KB

File metadata and controls

192 lines (124 loc) · 5.73 KB

🤝 Contributing to setup-solr-action

First off, thank you for considering contributing to setup-solr-action 🎉. Contributions, issues, and feature requests are welcome!


📑 Table of Contents


🛠️ Getting Started

  1. Fork this repository.
  2. Clone your fork locally:
   git clone https://github.com/dhavalgojiya/setup-solr-action.git
   cd setup-solr-action
  1. Use the supported Node.js version (currently Node.js 24). This project pins the required Node.js version in .nvmrc (this is the Node.js runtime version, not npm or nvm). If you use nvm, just run the following inside the project directory to switch to the correct Node.js version:

    nvm use

    💡 If Node.js 24 isn't installed yet, just run nvm install — it reads .nvmrc, installs the correct Node.js version, and switches to it automatically.

  2. Install project dependencies:

    npm install

    This will set up all required packages defined in package-lock.json for development.


🧹 Code Quality (Linting & Formatting)

We use Biome for linting and formatting, along with shfmt for shell scripts.

  • Run linting & formatting checks:

    npm run check

    This will automatically apply fixes for formatting/lint issues across the project.

  • Format shell scripts (in src/scripts/):

    npm run format:sh

🪝 Git Hooks (prek)

We use prek to run our Git hooks. prek is a drop-in replacement for pre-commit that reuses the same .pre-commit-config.yaml. Unlike pre-commit (written in Python), prek is written in Rust and ships as a single dependency-free binary for faster, simpler installs.

  • Install prek:

    uv tool install prek   # or: brew install prek
  • Enable the hooks in your local clone:

    prek install

    The hooks now run automatically on every git commit.

  • Run all hooks against the whole repository manually:

    prek run --all-files

    The same hooks run in CI, so running them locally helps you catch issues before pushing.


📦 Build

We use tsup to bundle the action. This compiles the source code into a distributable format inside the dist/ folder.

  • Run build:

    npm run build

    After running this, the final output can be found in dist/.


⚡ All-in-One Command

For convenience, you can run everything (install → lint → format → build) with a single command:

npm run all

This ensures your environment is clean and ready for contribution.


🧪 Testing Locally

You can simulate the GitHub Action locally using nektos/act:

npm run act

This will run the action in a local environment, useful before pushing changes.


📥 Submitting a Pull Request

  1. Create a new branch from main for your work (don’t work directly on main):
git checkout -b feature/add-xyz
git checkout -b fix/solr-port-issue
git checkout -b docs/improve-readme

Branch names should follow the format:
> feature/... → new features
> fix/... → bug fixes
> docs/... → documentation updates

  1. Make your changes and commit with a clear message.

    We follow the Conventional Commits format: type(scope): short description, where scope is optional.

    git commit -m "fix: correct Solr port mapping issue"
    git commit -m "feat(solr): add support for custom Solr cores"
  2. Push your branch to your fork:

    git push origin feature/add-xyz
  3. Open a Pull Request (PR) against the main branch of this repository.

    In the PR description:

    • Link the related issue using Fixes #<issue_number> (if applicable).
    • Explain what your PR changes or adds.
    • If it’s a new feature, provide usage examples.
    • If possible, add/update tests to cover your changes.

📜 Guidelines

  • Follow existing coding style and formatting.
  • Keep commits clean and meaningful.
  • Update documentation (README, comments) if you change behavior.
  • Pull requests should be small and focused.

🙌 Thank You

Every contribution counts! Whether it's fixing a typo, improving documentation, or suggesting a new feature — we appreciate your efforts 💙.