Thank you for your interest in contributing! This document provides guidelines and prerequisites for working on this project.
# Clone the repository
git clone https://github.com/incident-io/github-action.git
cd github-action
# Install dependencies
npm install
# Verify everything works
npm run allThe npm run all command runs the full validation pipeline:
- Code formatting
- Linting (TypeScript, Markdown)
- Type checking
- Tests (109 unit tests)
- Coverage report
- Build
# Run tests in watch mode
npm run test:watch
# Format code
npm run format:write
# Lint code
npm run lint
# Type check
npm run typecheck
# Build for distribution
npm run package
# Run everything (before committing)
npm run allRead these files to understand the architecture:
- AGENTS.md - Critical gotchas and non-obvious patterns
- README.md - User-facing documentation and examples
- INTEGRATION_TESTS.md - Integration testing guide
Key architectural points:
- Entry point: src/index.ts → src/main.ts
- Handler pattern: Event handlers in src/handlers.ts with
CustomHandlermust be last - ES modules: All imports must use
.jsextensions (TypeScript quirk) - Test framework: Vitest (not Jest)
- Committed dist: The dist/ directory is committed (GitHub Actions requirement)
We use automated formatting and linting:
- Prettier for code formatting
- ESLint for code quality
- markdownlint for Markdown files
- gitleaks for secrets detection
Run npm run all before committing to ensure everything passes.
- Unit tests: Add to
__tests__/with.test.tsextension - Use Vitest: Import from
vitest, notjest - Mock APIs: See tests/incident-client.test.ts for examples
- Run tests:
npm testornpm run test:watch
Example test structure:
import { describe, it, expect, vi } from "vitest";
describe("MyComponent", () => {
it("should do something", () => {
expect(true).toBe(true);
});
});Critical: After changing src/, you must rebuild and commit dist/:
npm run bundle
git add src/ dist/
git commit -m "Your change description"Why? GitHub Actions run the pre-built dist/index.js, not the source files.
Integration tests require a real incident.io API key:
# Set environment variable
export INCIDENT_TEST_API_KEY="your-test-api-key"
# Run integration tests
npm run test:integrationSee INTEGRATION_TESTS.md for details.
- main - Production-ready code
- feature/* - New features
- fix/* - bugfixes
- docs/* - Documentation updates
Use clear, descriptive commit messages:
Add integration testing infrastructure
Add comprehensive integration testing setup to validate action behavior
against real incident.io API.
Changes:
- Add integration test workflow
- Add documentation
- Add npm script
- Fork the repository (external contributors)
- Create a branch from
main - Make changes and ensure
npm run allpasses - Commit with clear messages
- Push and create a pull request
- Respond to review feedback
PR checklist:
-
npm run allpasses locally - Tests added/updated for changes
- Documentation updated if needed
-
dist/rebuilt and committed - No secrets committed (gitleaks passes)
See AGENTS.md for critical patterns and gotchas.
Run gitleaks locally: gitleaks detect
Suppress false positives with // gitleaks:allow comments.
All pull requests run through CI:
- Linter - Code quality checks
- CI - Tests and type checking
- Check dist/ - Verifies dist/ is up to date
- Licensed - License compliance
Ensure all checks pass before merging.
This project uses AI-powered changelog generation for PRs:
How it works:
- When your PR is ready for review, add the label
ready-for-changelog - A GitHub Action automatically generates a changelog entry from your PR diff
- The entry is committed to
CHANGELOG.mdunder the "Unreleased" section - Review the generated entry and edit if needed (directly in
CHANGELOG.md) - The entry will be included in the next release
Manual trigger:
- Go to Actions → Generate Changelog Entry → Run workflow → Select your PR
Tips for better changelogs:
- Write clear PR titles (they help the AI understand your changes)
- Add a detailed PR description explaining the "why"
- Use labels to help categorize (e.g.,
bug,enhancement,breaking-change)
Releases are created manually by maintainers using a GitHub Actions workflow.
For detailed release instructions, see .github/RELEASE.md.
Quick overview:
- All PRs with changelog entries are merged to
main - Maintainer triggers the Release workflow via GitHub Actions UI
- Workflow automatically:
- Bumps version in
package.json - Rebuilds
dist/ - Finalizes
CHANGELOG.md - Creates Git tags
- Creates GitHub Release
- Bumps version in
Version tags:
- Specific:
v0.1.0(immutable) - Minor:
v0.1(moves with patches) - Major:
v0(moves with minor/patch)
Users can reference the action using any of these tags:
uses: incident-io/github-action@v0 # Tracks latest v0.x.x
uses: incident-io/github-action@v0.1 # Tracks latest v0.1.x
uses: incident-io/github-action@v0.1.0 # Pinned to exact version- Issues: Use GitHub Issues for bugs and feature requests
- Discussions: For questions and general discussion
- Architecture: See AGENTS.md for non-obvious patterns
- API Docs: incident.io API Documentation
Be respectful, inclusive, and constructive. We're all here to build great software together.
By contributing, you agree that your contributions will be licensed under the MIT License.