Contributing to AI Workflow Failure Summary ActionΒΆ
Thank you for your interest in contributing! This document provides guidelines and information for contributors.
π Table of ContentsΒΆ
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Testing
- Submitting Changes
- Documentation
- Release Process
Code of ConductΒΆ
This project adheres to a Code of Conduct that all contributors are expected to follow. Please read CODE_OF_CONDUCT.md before contributing.
Getting StartedΒΆ
PrerequisitesΒΆ
- Node.js 20 or higher
- npm 9 or higher
- Git
- A GitHub account
Finding Issues to Work OnΒΆ
- Check the issue tracker
- Look for issues labeled
good first issuefor beginner-friendly tasks - Issues labeled
help wantedare great for contributions - Feel free to create new issues for bugs or feature requests
Development SetupΒΆ
- Fork and Clone
# Fork on GitHub, then:
git clone https://github.com/YOUR_USERNAME/ai_summary_action.git
cd ai_summary_action
- Install Dependencies
- Set Up Environment
Create a .env file for local testing (never commit this):
Project StructureΒΆ
ai_summary_action/
βββ .github/
β βββ workflows/ # GitHub Actions workflows
β βββ prompts/ # Example prompt templates
βββ docs/ # MkDocs documentation
βββ src/
β βββ index.ts # Main entry point
β βββ analyzer.ts # AI analysis logic
β βββ github-client.ts # GitHub API interactions
βββ dist/ # Compiled JavaScript (committed)
βββ action.yml # Action metadata
βββ mkdocs.yml # MkDocs configuration
βββ package.json # Node.js dependencies
βββ tsconfig.json # TypeScript configuration
Making ChangesΒΆ
Branch NamingΒΆ
Use descriptive branch names:
# Features
git checkout -b feature/add-custom-prompts
git checkout -b feature/support-new-llm
# Bug fixes
git checkout -b fix/issue-123-log-parsing
git checkout -b fix/timeout-error
# Documentation
git checkout -b docs/improve-quickstart
git checkout -b docs/add-examples
Code StyleΒΆ
We use automated formatting and linting:
Key Conventions: - Use TypeScript for all new code - Follow existing code patterns - Add JSDoc comments for public functions - Use meaningful variable names - Keep functions small and focused
Commit MessagesΒΆ
Follow the Conventional Commits specification:
# Features
git commit -m "feat: add custom prompt support"
git commit -m "feat(analyzer): support streaming responses"
# Fixes
git commit -m "fix: resolve log truncation issue"
git commit -m "fix(github-client): handle rate limiting"
# Documentation
git commit -m "docs: improve installation guide"
git commit -m "docs(api): add examples for custom prompts"
# Chores
git commit -m "chore: update dependencies"
git commit -m "chore(ci): improve workflow performance"
TestingΒΆ
Build the ActionΒΆ
This compiles TypeScript and bundles everything into dist/index.js.
Local TestingΒΆ
Test the action locally:
# Set environment variables
export INPUT_GITHUB_TOKEN="..."
export INPUT_LLM_PROVIDER="openai"
export INPUT_OPENAI_API_KEY="..."
# Run the action
node dist/index.js
Testing in a WorkflowΒΆ
Create a test workflow in your fork:
name: Test Changes
on:
workflow_dispatch:
jobs:
fail-test:
runs-on: ubuntu-latest
steps:
- run: exit 1
test-action:
runs-on: ubuntu-latest
if: failure()
needs: [fail-test]
steps:
- uses: actions/checkout@v4
- uses: ./
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
Automated TestsΒΆ
Run existing tests (when available):
Submitting ChangesΒΆ
Pull Request ProcessΒΆ
- Update Your Branch
- Build and Test
- Commit dist/ Directory
β οΈ Important: Always commit the built dist/ directory:
- Push to Your Fork
-
Create Pull Request
-
Go to the repository on GitHub
- Click "New Pull Request"
- Select your branch
- Fill out the PR template
- Link related issues
Pull Request TemplateΒΆ
Your PR should include:
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation update
- [ ] Code refactoring
## Testing
How did you test these changes?
## Checklist
- [ ] Code follows project style guidelines
- [ ] Built and committed dist/ directory
- [ ] Updated documentation if needed
- [ ] Tested locally
- [ ] Added/updated tests (if applicable)
## Related Issues
Fixes #123
DocumentationΒΆ
Writing DocumentationΒΆ
Documentation is written in Markdown and built with MkDocs.
- Preview Documentation Locally
# Install MkDocs
pip install mkdocs-material mkdocs-mermaid2-plugin
# Serve locally
mkdocs serve
# Visit http://127.0.0.1:8000
-
Documentation Guidelines
-
Use clear, concise language
- Include code examples
- Add diagrams where helpful (Mermaid)
- Test all code examples
- Keep structure consistent
-
Add links to related pages
-
Adding New Pages
Update mkdocs.yml:
Release ProcessΒΆ
For maintainers:
- Update Version
- Update Changelog
Update docs/changelog.md with changes.
- Create Release
- GitHub Release
Create a release on GitHub with: - Release notes from changelog - Link to documentation - Migration guide (if breaking changes)
Getting HelpΒΆ
- π¬ GitHub Discussions
- π Issue Tracker
- π Documentation
RecognitionΒΆ
Contributors are recognized in: - Release notes - Contributors section in README - GitHub's contributor graph
Thank you for contributing! π