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