This guide outlines how to set up the PR Pilot Review project for local development, run tests, and build the action.
Ensure you have the following installed on your development machine:
- Node.js (Version 20 or higher)
- npm (Version 10 or higher)
- Git
-
Clone the repository:
git clone https://github.com/bishalprasad321/prpilot-review.git cd prpilot-review -
Install project dependencies:
npm install
The source code is located in the src/ directory. The project uses TypeScript.
The following npm scripts are available for development:
npm run typecheck: Validates TypeScript types.npm run lint: Runs ESLint to check for code quality issues.npm run format: Automatically fixes formatting issues using Prettier.npm run test: Runs the Jest test suite.npm run build: Bundles the action using@vercel/nccinto thedist/directory.npm run verify: Verifies the generated bundle.npm run all: Runs formatting, linting, typechecking, tests, and the build process sequentially.
- Create a new branch for your feature or bugfix:
git checkout -b feature/your-feature-name
- Make your modifications within the
src/directory. - Ensure your code passes all checks:
npm run all
- Important: The GitHub Action runs from the compiled
dist/index.jsfile. You must build the project and commit thedist/directory for your changes to take effect in the action.npm run build git add dist/ git commit -m "Build dist bundle"
The project uses Jest for unit testing. You can run the tests locally:
npm test # Run all tests
npm test -- --watch # Run tests in watch mode
npm test -- --coverage # Generate a coverage reportIntegration tests are defined in .github/workflows/action-test.yml. You can trigger these manually via the GitHub Actions UI:
- Navigate to the Actions tab in your repository.
- Select the Test Action - Multi-Model Consensus Review Integration workflow.
- Click Run workflow. You can configure options like
debug_enabledandmodel_presetbefore running.
To test your changes in a real PR environment:
- Push your branch and create a Pull Request against the
developormainbranch. - The action will automatically run against your PR if the workflow is configured.
- Review the action logs and the generated PR comments to verify behavior.