A comprehensive Salesforce DX project showcasing enterprise-grade integrations, security best practices, and modern development patterns.
Secure, bidirectional integration between Salesforce and GitHub Actions using GitHub App authentication.
- ✅ Trigger GitHub workflows directly from Salesforce
- ✅ Receive webhook notifications when workflows complete
- ✅ JWT-based authentication (no personal access tokens)
- ✅ Enterprise security with Protected Custom Metadata
- ✅ Visual interface with Lightning Web Components
📖 Read the Complete Documentation →
- FinancialForce (fflib) Libraries: Domain, Selector, Service, and Unit of Work patterns
- Apex Mocks: Comprehensive mocking framework for unit testing
- Modular Design: Organized packages for reusability
- DevContainer Support: Fully configured development environment with Docker
- CI/CD Pipelines: GitHub Actions workflows for automated testing and deployment
- Feature Branch Validation: Automated scratch org creation and validation on PRs
- Code Quality Checks: ESLint and Prettier integration
sf-develop-demo/
├── apex-common/ # fflib enterprise patterns
├── apex-mocks/ # Testing framework
├── force-app/ # Core Salesforce metadata
├── github-action-service/ # GitHub integration package
├── weather-app/ # Sample application
├── docs/ # Documentation
│ └── github-integration/
│ ├── README.md # Overview & architecture
│ ├── SETUP.md # Setup instructions
│ └── SECURITY.md # Security best practices
└── scripts/ # Automation scripts
- Salesforce CLI (
sfcommand) - Node.js 18+ (for LWC development)
- Git
- Docker (for DevContainer support)
This project includes a complete DevContainer configuration for consistent development environments.
# Open in VS Code with DevContainers extension
code .
# VS Code will prompt to "Reopen in Container"Included in DevContainer:
- ✅ Salesforce CLI pre-installed
- ✅ Node.js 18+ with dependencies
- ✅ Git and essential tools
- ✅ VS Code Salesforce extensions
- ✅ Consistent environment across team
# Create scratch org
./scripts/create_scratch_org.sh
# Deploy all metadata
sf project deploy start
# Assign permissions
sf org assign permset --name GitHub_Integration_Admin- Create GitHub App - Follow the setup guide
- Configure credentials in Custom Metadata Type
- Test connection using the LWC component
- Protected Custom Metadata: Credentials secured at platform level
- JWT Authentication: Industry-standard server-to-server auth
- HMAC Webhook Verification: Ensures payload integrity
- Named Credentials: Centralized endpoint management
- Short-lived Tokens: 10-minute JWT, 1-hour installation tokens
This integration uses Protected Custom Metadata instead of Salesforce External Credentials because:
⚠️ Incompatible Key Format: GitHub Apps provide private keys in PKCS#1 format, but Salesforce certificates require X.509 format with additional metadata⚠️ No Certificate Chain: GitHub's private keys are standalone RSA keys without the certificate chain required by Salesforce⚠️ Manual Conversion Issues: Converting GitHub's keys to X.509 certificates requires complex OpenSSL operations that often fail- ✅ Better Alternative: Protected Custom Metadata provides equivalent security while accepting base64-encoded keys directly
See Security Documentation for details.
| Document | Description |
|---|---|
| GitHub Integration Overview | Architecture, flows, and component details |
| Setup Guide | Step-by-step configuration |
| Security Best Practices | Security implementation and recommendations |
| Dispatch Event Framework | Structured event dispatching framework |
| Quick Reference | Commands, snippets, and troubleshooting |
| Weather Demo | Sample weather application |
# Run all tests
sf apex run test --test-level RunLocalTests --wait 10
# Run specific test class
sf apex run test --tests GitHubActionsServiceTest --code-coverage# Set target org
sf config set target-org your-sandbox-alias
# Deploy
sf project deploy start --source-dir force-app# Tail logs in real-time
sf apex tail log --color
# View debug logs
sf apex get log --number 1- Apex Classes:
GitHubAppAuthService,GitHubActionsService,GitHubWebhookService - LWC Component:
gitHubActionTrigger - Custom Metadata:
GitHub_App_Settings__mdt - Named Credentials:
GitHub_API
- apex-common: FinancialForce application framework
- apex-mocks: Mocking framework for testing
This is a demonstration project showcasing enterprise Salesforce development patterns. Feel free to use these patterns in your own projects.
This project is for demonstration purposes.
- Salesforce DX Developer Guide
- Salesforce CLI Command Reference
- GitHub Apps Documentation
- JWT Authentication
Built with ❤️ for the Salesforce community