Thank you for your interest in contributing! This document provides guidelines and instructions for contributing to this project.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/code-quality-action.git cd code-quality-action - Install dependencies:
npm install
-
Create a new branch:
git checkout -b feat/my-new-feature # or git checkout -b fix/my-bug-fix -
Make your changes in the
src/directory -
Build and test:
npm run all
This will:
- Compile TypeScript
- Format code with Prettier
- Lint code with ESLint
- Package to
dist/
-
Commit your changes using Conventional Commits:
git add . git commit -m "feat: add new feature"
We use Conventional Commits for all commit messages. This enables automatic versioning and changelog generation.
Format:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Types:
feat:- New feature (minor version bump)fix:- Bug fix (patch version bump)docs:- Documentation only changesstyle:- Code style changes (formatting, missing semi-colons, etc)refactor:- Code refactoring without feature changesperf:- Performance improvementstest:- Adding or updating testschore:- Maintenance tasks, dependency updatesci:- CI/CD configuration changesbuild:- Build system or external dependency changes
Breaking Changes:
Add ! after the type or include BREAKING CHANGE: in the footer:
git commit -m "feat!: redesign API
BREAKING CHANGE: The old API is no longer supported"Examples:
# Feature
git commit -m "feat: add TYPO3 Rector support"
# Bug fix
git commit -m "fix: resolve PHPStan config resolution"
# Documentation
git commit -m "docs: update README with new examples"
# Refactoring
git commit -m "refactor: simplify config resolver logic"
# Breaking change
git commit -m "feat!: change action to composite
BREAKING CHANGE: Action now requires actions/checkout@v4"- Use TypeScript for all source code
- Follow existing code style
- Add type annotations where needed
- Use interfaces for type definitions
Code is automatically formatted with Prettier. Run:
npm run formatCode is linted with ESLint. Run:
npm run lintTo add support for a new code quality tool:
-
Create the runner in
src/runners/your-tool.ts:import * as core from '@actions/core'; import { ToolRunner, RunnerConfig, ToolResult } from '../types'; import { executeCommand } from '../utils/exec'; export class YourToolRunner implements ToolRunner { async run(config: RunnerConfig): Promise<ToolResult> { core.info('Running Your Tool...'); // Implementation } }
-
Update types in
src/types.ts:export type ToolName = 'existing-tools' | 'your-tool';
-
Update config resolver in
src/config/resolver.ts -
Update main.ts to import and integrate the new runner
-
Update action.yml to add new inputs if needed
-
Update README.md with documentation
Before submitting a PR:
-
Build successfully:
npm run build
-
Pass linting:
npm run lint
-
Format code:
npm run format
-
Package successfully:
npm run package
-
Commit dist/ changes: The
dist/directory must be committed with your changes.
-
Push your branch to your fork:
git push origin feat/my-new-feature
-
Create a Pull Request on GitHub
-
Describe your changes:
- What does this PR do?
- Why is this change needed?
- How has it been tested?
-
Wait for CI checks to pass
-
Address review feedback if any
-
Merge: Once approved, a maintainer will merge your PR
Releases are automated via semantic-release:
- Merge to main - PR is merged
- CI runs - Builds and tests
- semantic-release - Analyzes commits and creates release
- GitHub Release - Created with changelog
- Tags updated - Version tags and major version tag
You don't need to manually create releases or update version numbers!
- Open an issue for bugs or feature requests
- Start a discussion for questions or ideas
Thank you for contributing!