6.2 KiB
GitHub Workflows Documentation
This directory contains automated workflows for CI/CD, code quality, and AI-assisted development.
Workflows Overview
1. CI/CD Workflow (ci.yml)
Triggered on: Push to main/master/develop branches, Pull requests
Jobs:
- Lint: Runs ESLint to check code quality
- Build: Builds the application and uploads artifacts
- E2E Tests: Runs Playwright end-to-end tests
- Quality Check: Checks for console.log statements and TODO comments
2. Automated Code Review (code-review.yml)
Triggered on: Pull request opened, synchronized, or reopened
Features:
- Analyzes code changes for security issues (eval, innerHTML, XSS risks)
- Checks for code quality issues (console.log, debugger, any types)
- Provides suggestions for improvements
- Auto-approves PRs if no blocking issues are found
- Adds appropriate labels (needs-changes, ready-for-review, has-warnings)
Review Criteria:
- ✅ Security vulnerabilities
- ✅ Code quality issues
- ✅ Type safety
- ✅ React best practices
- ✅ File size warnings
3. Auto Merge (auto-merge.yml)
Triggered on: PR approval, CI workflow completion
Features:
- Automatically merges PRs when:
- PR is approved by reviewers
- All CI checks pass (lint, build, e2e tests)
- No merge conflicts
- PR is not in draft
- Automatically deletes the branch after successful merge
- Uses squash merge strategy
- Posts comments about merge status
4. Issue Triage (issue-triage.yml)
Triggered on: New issues opened, issues labeled
Features:
- Automatically categorizes and labels issues:
- Type: bug, enhancement, documentation, testing, security, performance
- Priority: high, medium, low
- AI-fixable flag for automated fixes
- Posts welcome message with issue summary
- Suggests automated fix attempts for simple issues
- Can create fix branches automatically with
create-prlabel
5. PR Management (pr-management.yml)
Triggered on: PR opened, synchronized, labeled
Features:
- Auto-labels PRs based on changed files:
- workflows, tests, documentation, ui, styling, configuration, dependencies
- Size labels (small/medium/large)
- Type labels from PR title (bug, enhancement, refactor, etc.)
- Validates PR descriptions
- Links related issues automatically
- Posts comments on related issues
6. Merge Conflict Check (merge-conflict-check.yml)
Triggered on: PR opened/synchronized, push to main/master
Features:
- Detects merge conflicts
- Posts comment mentioning @copilot to resolve
- Adds/removes
merge-conflictlabel - Fails CI if conflicts exist
Labels Used
Automated Labels
bug- Bug fixesenhancement- New featuresdocumentation- Documentation changestests- Test-related changessecurity- Security issuesperformance- Performance improvementsneeds-changes- PR requires changesready-for-review- PR is ready for reviewhas-warnings- PR has warnings to addresslarge-pr- PR with many changessize: small/medium/large- PR size indicatorsai-fixable- Issues that can be auto-fixedgood first issue- Good for newcomerspriority: high/medium/low- Issue prioritymerge-conflict- PR has merge conflictsauto-fix- Request automated fixcreate-pr- Create fix PR for issue
Configuration
ESLint
The project uses ESLint with TypeScript support and React-specific rules:
- File:
eslint.config.js - Strict type checking (warnings for gradual adoption)
- React hooks validation
- Code quality rules
Playwright E2E Tests
- Configuration:
playwright.config.ts - Tests directory:
e2e/ - Runs on Chromium browser
- Tests include:
- Login functionality
- Navigation
- CRUD operations
- Form interactions
Usage
Running Locally
# Run linter
npm run lint
# Fix linting issues automatically
npm run lint:fix
# Run e2e tests
npm run test:e2e
# Run e2e tests with UI
npm run test:e2e:ui
# Run e2e tests in headed mode
npm run test:e2e:headed
# Build the project
npm run build
Triggering Workflows
For Issues:
- Create an issue - automatically triaged and labeled
- Add
auto-fixlabel to request automated fix - Add
create-prlabel to create a fix branch
For PRs:
- Open a PR - automatically reviewed, labeled, and validated
- Push changes - triggers CI/CD pipeline
- Get approval + pass tests - automatically merged and branch deleted
Working with AI Assistance
Request automated fixes:
- Comment "@copilot fix this issue" on any issue
- Add
ai-fixablelabel to issues that can be auto-fixed
Get code review feedback:
- Reviews are automatic on every PR
- Address feedback and push changes
- Workflow will re-review automatically
Best Practices
- Write descriptive PR titles - Used for automatic labeling
- Link issues in PR descriptions - Enables automatic issue closing
- Keep PRs focused and small - Easier to review and merge
- Address all review comments - Even warnings should be considered
- Test locally before pushing - Run lint and tests
- Don't commit console.log statements - Will be flagged in review
- Remove debugger statements - Treated as blocking issues
Troubleshooting
PR Not Auto-Merging
- Check that all CI checks passed
- Verify PR has approval
- Ensure no merge conflicts
- Confirm PR is not in draft mode
Tests Failing
- Run tests locally:
npm run test:e2e - Check test report artifacts in GitHub Actions
- Ensure dev server starts correctly
Linting Errors
- Run
npm run lint:fixto auto-fix - Review errors:
npm run lint - Check
eslint.config.jsfor rule configuration
Contributing
When adding new workflows:
- Document the workflow in this README
- Add appropriate error handling
- Test the workflow on a test branch
- Ensure proper permissions are set
- Add labels if needed (they'll be created automatically)
Security
Workflows use GITHUB_TOKEN with minimal required permissions:
contents: read/write- For reading code and merging PRspull-requests: write- For commenting and managing PRsissues: write- For managing issueschecks: read- For reading CI status
No secrets are required for basic functionality.