Automation Guide
This guide explains the automated features and workflows provided by Automanic.
GitHub Actions Workflows
Automanic generates several GitHub Actions workflows to automate your development process.
Continuous Integration (CI)
File: .github/workflows/ci.yml
Triggers:
- Push to
main or develop branches
- Pull requests to
main
Features:
- Multi-version testing (Python: 3.8-3.11, Node.js: 16-20)
- Code linting and formatting checks
- Test execution with coverage reporting
- Security scanning
- Artifact caching for faster builds
Language-Specific Actions:
Python:
- Black formatting check
- Flake8 linting
- MyPy type checking
- Pytest with coverage
- Bandit security scan
JavaScript/TypeScript:
- ESLint linting
- Prettier formatting check
- Jest testing
- TypeScript compilation (TS only)
- NPM audit security check
Go:
- Go fmt formatting check
- Go vet linting
- Go test with race detection
- Go mod tidy verification
- Gosec security scan
Automated Issue Management
File: .github/workflows/auto-management.yml
Features:
- Auto-labeling Issues:
- Analyzes issue title and content
- Applies relevant labels (bug, enhancement, documentation, etc.)
- Sets priority levels (high, medium, low)
- Estimates complexity
- Auto-assigning Pull Request Reviewers:
- Analyzes changed files
- Assigns experts based on file types
- Considers CODEOWNERS file
- Limits to 2 reviewers maximum
- Project Board Integration:
- Automatically adds issues to project boards
- Organizes by type and priority
- Updates status based on labels
Example Auto-labels:
# Content analysis triggers
'bug' keywords → bug label
'feature' keywords → enhancement label
'docs' keywords → documentation label
'security' keywords → security label
'performance' keywords → performance label
Release Automation
File: .github/workflows/auto-release.yml
Features:
- Semantic Versioning:
- Analyzes commit messages
- Determines version bumps
- Creates git tags
- Generates changelogs
- Automated Releases:
- Creates GitHub releases
- Publishes to package registries
- Uploads artifacts
- Notifies stakeholders
- Dependabot Auto-merge:
- Automatically merges passing dependency updates
- Requires all checks to pass
- Uses squash merge strategy
Commit Message Convention:
feat: add new feature (minor version bump)
fix: bug fix (patch version bump)
feat!: breaking change (major version bump)
docs: documentation update (no version bump)
Security Automation
File: .github/workflows/security.yml
Features:
- CodeQL Analysis:
- Static analysis for security vulnerabilities
- Supports multiple languages
- Creates security advisories
- Integrates with GitHub Security tab
- Dependency Scanning:
- Scans for vulnerable dependencies
- Creates security alerts
- Suggests updates
- Tracks resolution status
- Secret Scanning:
- Prevents committing secrets
- Scans for API keys, tokens
- Provides remediation guidance
Issue Templates
Automanic provides comprehensive issue templates to standardize bug reports, feature requests, and documentation updates.
Bug Report Template
File: .github/ISSUE_TEMPLATE/bug_report.md
Sections:
- Bug description
- Steps to reproduce
- Expected behavior
- Screenshots
- Environment details
- Possible solution
Feature Request Template
File: .github/ISSUE_TEMPLATE/feature_request.md
Sections:
- Feature description
- Problem statement
- Proposed solution
- Acceptance criteria
- Mockups/examples
- Design considerations
Documentation Template
File: .github/ISSUE_TEMPLATE/documentation.md
Sections:
- Documentation issue
- Location specification
- Content requirements
- Target audience
- Additional context
Pull Request Automation
PR Template
File: .github/PULL_REQUEST_TEMPLATE.md
Features:
- Change description
- Issue linking
- Change type classification
- Testing checklist
- Review checklist
Automated Checks
PR Validation:
- All tests must pass
- Code coverage requirements
- No merge conflicts
- Updated documentation
- Proper commit messages
Auto-merge Conditions:
- Dependabot PRs
- All checks passing
- Required reviews completed
- No conflicts
Development Environment Automation
Pre-commit Hooks
File: .pre-commit-config.yaml
Hooks:
- trailing-whitespace # Remove trailing whitespace
- end-of-file-fixer # Ensure files end with newline
- check-yaml # Validate YAML syntax
- check-ast # Validate Python AST
- black # Python formatting
- flake8 # Python linting
- isort # Import sorting
- mypy # Type checking
- bandit # Security linting
Development Scripts
File: scripts/dev.sh
Commands:
./scripts/dev.sh setup # Set up development environment
./scripts/dev.sh test # Run tests
./scripts/dev.sh coverage # Run tests with coverage
./scripts/dev.sh lint # Run linters
./scripts/dev.sh format # Format code
./scripts/dev.sh clean # Clean up generated files
./scripts/dev.sh docs # Build documentation
./scripts/dev.sh release # Prepare release
IDE Configuration
VS Code Settings:
- Python interpreter configuration
- Formatting on save
- Linting integration
- Testing integration
- Extension recommendations
Extensions:
- Language-specific extensions
- Git integration
- Testing frameworks
- Code quality tools
Deployment Automation
Docker Integration
Generated Files:
Dockerfile - Multi-stage builds
docker-compose.yml - Local development
.dockerignore - Optimize build context
Features:
- Language-optimized base images
- Security best practices
- Multi-architecture builds
- Health checks
Kubernetes Deployment
Generated Manifests:
- Deployment configurations
- Service definitions
- Ingress rules
- ConfigMaps and Secrets
- Horizontal Pod Autoscaling
AWS:
- ECR integration
- ECS/EKS deployment
- CloudFormation templates
- Lambda deployment (serverless)
Google Cloud:
- Container Registry
- Cloud Run deployment
- GKE integration
- Cloud Functions
Azure:
- Container Registry
- Container Apps
- AKS integration
- Azure Functions
Monitoring and Observability
Health Checks
Endpoints:
/health - Basic health check
/ready - Readiness probe
/metrics - Prometheus metrics
Logging
Configuration:
- Structured logging (JSON)
- Log levels (DEBUG, INFO, WARN, ERROR)
- Request/response logging
- Error tracking integration
Metrics
Prometheus Integration:
- Application metrics
- Custom metrics
- Grafana dashboards
- Alerting rules
Customizing Automation
Adding Custom Workflows
- Create new workflow file in
.github/workflows/
- Use existing workflows as templates
- Configure triggers and jobs
- Test with pull requests
Modifying Existing Workflows
- Edit workflow files directly
- Update trigger conditions
- Add/remove steps
- Configure environment variables
Environment Variables and Secrets
Required Secrets:
GITHUB_TOKEN - Automatically provided
DOCKERHUB_USERNAME - Docker registry
DOCKERHUB_TOKEN - Docker authentication
CODECOV_TOKEN - Coverage reporting
Environment Variables:
NODE_VERSION - Node.js version matrix
PYTHON_VERSION - Python version matrix
GO_VERSION - Go version
Integration with External Services
Supported Integrations:
- Codecov - Coverage reporting
- Snyk - Security scanning
- SonarCloud - Code quality
- Slack - Notifications
- Discord - Notifications
Best Practices
Workflow Organization
- Keep workflows focused - One workflow per purpose
- Use reusable workflows - Share common patterns
- Cache dependencies - Speed up builds
- Parallel jobs - Reduce total runtime
- Conditional execution - Skip unnecessary work
Security Considerations
- Minimal permissions - Use least privilege principle
- Secret management - Never hardcode secrets
- Dependency scanning - Regular security updates
- Code analysis - Static security analysis
- Branch protection - Enforce policies
- Efficient caching - Cache dependencies and build artifacts
- Matrix strategies - Test multiple configurations efficiently
- Conditional jobs - Skip jobs when not needed
- Resource limits - Optimize resource usage
- Workflow triggers - Avoid unnecessary runs
Troubleshooting
Common Issues
Workflow failures:
- Check workflow logs
- Verify environment variables
- Check secret configuration
- Validate YAML syntax
Permission issues:
- Check repository settings
- Verify secret access
- Review workflow permissions
- Check branch protection rules
Performance issues:
- Review cache usage
- Optimize job parallelization
- Reduce dependency installation time
- Use more specific triggers
Getting Help
- Check GitHub Actions documentation
- Review workflow run logs
- Use community actions
- Open issues for bugs
- Join discussions for help
For more information, see: