Thank you for your interest in contributing to Copilot. This document provides guidelines for setting up the project and submitting changes.
- Node.js 20 – Use
nvm use 20if you have nvm. - Git – A GitHub repository with
originpointing to a valid GitHub URL.
nvm use 20
npm install
npm run build| Command | Description |
|---|---|
npm run build |
Compiles src/actions/github_action.ts → build/github_action/, src/cli.ts → build/cli/, and sets the CLI as executable. |
npm test |
Runs Jest tests (exclude e2e when relevant). |
npm run test:watch |
Runs tests in watch mode. |
npm run test:coverage |
Runs tests with coverage report. |
npm run lint |
Runs ESLint on src/ (recommended rules + unused-vars, no-explicit-any). |
npm run lint:fix |
Auto-fixes fixable lint issues. |
src/actions/– GitHub Action and CLI entry points.github_action.ts– GitHub Action entry; reads inputs and runs the main flow.local_action.ts– CLI entry; same logic with local/config inputs.common_action.ts– Shared flow: single actions vs issue/PR/push pipelines.
src/usecase/– Use cases (issue, pull request, commit, single actions).src/manager/– Content handlers for PR descriptions, hotfix changelog, and markdown (e.g.configuration_handler,markdown_content_hotfix_handler).src/data/model/– Domain models (Execution, Ai, Issue, etc.).src/data/repository/– Repositories (GitHub API, OpenCode API).src/utils/– Constants, logger, content utils, etc.action.yml– Action metadata and input definitions.build/– Compiled output (bundled JS); do not edit directly.
- TypeScript – Prefer TypeScript; keep action and CLI buildable with
ncc. - Constants – Use
INPUT_KEYSandACTIONSfromsrc/utils/constants.tsinstead of ad-hoc strings. - Logging – Use existing logger (
logInfo,logError,logDebugInfo) fromsrc/utils/logger.ts. - New inputs – When adding inputs:
- Update
action.yml - Add to
INPUT_KEYSinsrc/utils/constants.ts - Read the input in
github_action.ts(and optionallylocal_action.ts)
- Update
- Run
npm run lintbefore submitting; fix issues withnpm run lint:fix. - Add or update tests for new functionality.
- Run
npm testto ensure all tests pass.
- Update the relevant docs in
docs/when changing behavior or adding features. - For user-facing changes, update
README.mdand the docs at docs.page/vypdev/copilot. - The project uses docs.page (invertase) for publishing; see
docs.jsonfor sidebar structure. - Use only docs.page components so the site builds without errors: Card, CardGroup (for multiple cards in a row; use
cols={2}orcols={3}), Callouts (Info, Warning, Error, Success only — do not use Note or Tip), Tabs, Accordion, Steps, Code Group, etc. Do not use Mintlify-only components such as Columns (use CardGroup instead). See docs.page Components.
Hooks are installed when you run npm install (postinstall). To reinstall: node scripts/install-git-hooks.cjs. Works on Windows, macOS, and Linux. On Windows, use Git for Windows so hooks run with Bash (the pre-commit launcher is a shell script).
- prepare-commit-msg — Adds the current branch name as prefix to the commit message (with
/replaced by-), e.g.feature-292-github-action-rename: add concurrency to CI. - pre-commit — Before each commit, runs
npm run build,npm test, andnpm run lint. The commit is aborted if any of these fail.
- Fork the repository and create a branch from
masterordevelop(if applicable). - Make your changes, following the conventions above.
- Ensure tests pass and lint is clean.
- Submit a pull request with a clear description of the changes.
- Link the PR to an issue if applicable (Copilot will help with that!).
Open an issue on GitHub or check the Support page in the documentation.