Thank you for your interest in contributing! This document provides guidelines for contributing to this repository.
- Code of Conduct
- Getting Started
- Development Workflow
- Action Development Guidelines
- Testing
- Documentation
- Submitting Changes
- Action Ideas
This project follows the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code.
- Fork the repository and clone it locally
- Install dependencies:
pnpm install - Set up your development environment:
# Install act for local testing (optional but recommended) brew install act # macOS # or curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash # Linux
git checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fixFollow the Action Development Guidelines below.
# Run all tests
pnpm test
# Run specific test types
pnpm test:integration
pnpm test:unit
# Run linting
pnpm lintUse clear, descriptive commit messages:
git commit -m "feat(setup-node): add yarn berry support"
git commit -m "fix(comment): handle empty tag input properly"
git commit -m "docs(npm-pr-version): update README with new examples"Each action should be in its own directory at the repository root:
action-name/
├── action.yml # Action definition
├── README.md # Action documentation
└── [implementation files]- Use kebab-case for action directory names
- Action names should be descriptive and follow the pattern:
verb-nounornoun-verb - Examples:
setup-node-and-install,npm-pr-version,comment
name: action-name
description: Clear, concise description of what the action does
inputs:
input-name:
description: Clear description of the input parameter
required: true|false
default: 'default-value' # if applicable
outputs:
output-name:
description: Clear description of the output
value: '${{ steps.step-id.outputs.output-name }}'
runs:
using: composite
steps:
# Implementation steps- Use composite actions for consistency and transparency
- Validate inputs early with clear error messages
- Handle errors gracefully with actionable feedback
- Use consistent formatting:
- ❌ for errors
- ✅ for success messages
- 📦 for package manager operations
- 📋 for informational messages
- Support multiple package managers when applicable (npm/yarn/pnpm)
- Follow security best practices - never log secrets or sensitive data
# Good error handling example
if [ ! -f "package.json" ]; then
echo "❌ ERROR: package.json not found in current directory"
echo "Make sure you're running this action in a directory with a package.json file"
exit 1
fiWhen applicable, detect package managers in this order:
yarn.lock→ yarnpnpm-lock.yaml→ pnpmpackage-lock.json→ npm- No lockfile → npm (default)
tests/
├── integration/ # Full action tests
│ └── action-name/
│ └── basic.bats
├── fixtures/ # Test data
│ ├── package-json/
│ └── lockfiles/
└── scripts/
├── test-runner.sh
└── test-helpers.sh- Create integration tests for each action in
tests/integration/action-name/ - Use the bats testing framework for shell script testing
- Test error conditions as well as success scenarios
- Use test fixtures from
tests/fixtures/when possible
Example test:
@test "action-name: handles valid input" {
# Setup
cp "$BATS_TEST_DIRNAME/../../../tests/fixtures/package-json/valid.json" package.json
# Test
run bash -c 'your-test-command'
# Assertions
assert_success
assert_output_contains "expected-output"
}# All tests
pnpm test
# Specific action tests
./tests/scripts/test-runner.sh integrationEach action should have a comprehensive README.md with:
- Title and description
- Table of contents (for longer READMEs)
- Usage section with basic example
- Inputs table with descriptions
- Outputs table (if applicable)
- Examples section with various use cases
- Special features (package manager detection, etc.)
- Update action README when changing inputs/outputs
- Run
pnpm docs:generateto auto-update the main project README - Update CLAUDE.md when changing project structure
- Add inline comments for complex logic
The main project README's "Available Actions" section is automatically generated from:
action.ymlfiles (name, description, inputs, outputs)- Individual action README files (usage examples)
When to regenerate documentation:
- After adding a new action
- After changing action.yml inputs/outputs
- After updating action descriptions
- Before submitting a PR
# Generate updated documentation
pnpm docs:generate
# Review the changes
git diff README.md- Create a descriptive PR title:
feat(action-name): add new feature - Fill out the PR template completely
- Link related issues using keywords (Closes #123)
- Request review from maintainers
- Address feedback promptly and respectfully
- All tests pass
- Code follows existing style guidelines
- Documentation is updated
- Changes are tested in real GitHub Actions workflows
- No security vulnerabilities introduced
- Automated checks must pass (tests, linting, security scans)
- Manual review by maintainers
- Testing in real-world scenarios
- Approval and merge
Looking for contribution ideas? Here are some actions that would be valuable:
cache-restore-save- Advanced caching patternsmonorepo-changed- Detect changed packages in monoreposperformance-test- Lighthouse/performance testing