GitHub New Commit
Triggers when a commit is pushed to a GitHub repository branch
Node Type
Trigger
Category
GitHub Integration
Icon
GitCommit
Overview
The GitHub New Commit node is a trigger that activates workflows when new commits are pushed to a specified GitHub repository and branch. This powerful integration enables automated responses to code changes, CI/CD workflows, and repository monitoring.
Key Features
- • Branch-Specific Triggers: Monitor specific branches for commits
- • Repository Filtering: Target specific repositories or owner/repo combinations
- • Commit Metadata: Access commit SHA, message, and URL information
- • Real-time Activation: Instant workflow triggering on push events
- • Webhook-Based: Uses GitHub webhooks for reliable event delivery
- • Security: Webhook signature verification for secure integration
Prerequisites
GitHub Integration
Must be connected to access GitHub API
Repository Access
Required permissions for repository monitoring
Webhook Configuration
GitHub webhook setup for push events
Node Configuration
Required Fields
Repository
Repository URL or owner/repo format (e.g., 'https://github.com/acme/tools' or 'acme/tools'). Must be a repository you have access to.
Branch
Branch name to monitor for commits (e.g., 'main', 'develop', 'feature/new-feature'). Only commits pushed to this specific branch will trigger the workflow.
Technical Details
Webhook Trigger Process
How the node receives GitHub webhook events and triggers workflow execution
Webhook Reception
The GitHub New Commit trigger receives webhook events through GitHub's webhook infrastructure: Repository Configuration monitors specified repository and branch combinations, Event Filtering validates that push events match the configured branch, Data Extraction extracts commit metadata from the webhook payload, and Workflow Trigger automatically starts workflow execution with commit data.
Trigger Execution
Uses the _trigger method to process incoming webhook data and provide it to the workflow. The node cannot be executed as part of a workflow graph since it's a trigger node.
Data Processing
How the node processes and validates GitHub webhook data
Webhook Validation
The node validates incoming webhook data to ensure it contains the expected repository, branch, and commit information before triggering the workflow.
Error Handling
If an error occurs during webhook processing, the node returns an error message, allowing workflows to handle failures gracefully and provide appropriate responses.
Security Verification
The node verifies webhook signatures to ensure the payload is authentic and comes from GitHub, protecting against unauthorized triggers.
Examples & Use Cases
CI/CD Pipeline Trigger
Automatically trigger builds and deployments on commits
{
"repository": "mycompany/myapp",
"branch": "main"
}Triggers deployment workflows whenever code is pushed to the main branch of the myapp repository.
Feature Branch Monitoring
Monitor specific feature branches for development updates
{
"repository": "acme/webapp",
"branch": "feature/user-authentication"
}Monitors the feature/user-authentication branch for commits and can trigger code review workflows or notifications.
Automated Documentation
Generate documentation updates on code changes
Workflow Structure
Automatically update documentation when commits are pushed to the main branch.
Code Quality Monitoring
Monitor commits for quality and security issues
Workflow Structure
Analyze each commit for potential issues and send notifications to the development team.
Workflow Examples
Automated Release Process
Complete release automation triggered by commits
Workflow Structure
Implementation Steps
- GitHub New Commit: Triggers on commits to main branch
- Branch Check: Verify commit is on the correct branch
- Build Process: Compile and prepare the application
- Testing: Run automated tests on the new commit
- Packaging: Create deployment packages
- Deployment: Deploy to staging or production
- Notification: Send status updates to the team
Best Practices
Do's
- • Use specific branch names to avoid triggering on unwanted commits
- • Verify repository access before configuring the trigger
- • Test webhook configuration with sample commits
- • Use commit message analysis for conditional logic
- • Store commit SHA for audit trails and rollback capabilities
- • Implement proper error handling for webhook failures
- • Monitor webhook delivery and retry failed events
Don'ts
- • Don't monitor too many repositories simultaneously
- • Avoid triggering on every branch unless necessary
- • Don't ignore webhook signature verification
- • Avoid processing sensitive data without encryption
- • Don't forget to handle webhook timeout scenarios
- • Avoid creating workflows that run too frequently
- • Don't skip validating repository access permissions
Security
- • Always verify webhook signatures from GitHub
- • Use HTTPS endpoints for webhook URLs
- • Implement rate limiting to prevent abuse
- • Monitor webhook access logs regularly
- • Use secure secret tokens for webhook authentication
- • Validate repository permissions before processing
- • Encrypt sensitive data in workflow processing
Troubleshooting
Common Issues
Webhook Not Triggering
Symptoms: Commits are pushed but workflow doesn't start
Solution: Verify the webhook URL is correct in GitHub repository settings, check that the branch name matches exactly, and ensure the webhook is configured for 'push' events. Test by making a small commit to verify the setup.
Wrong Repository Triggering
Symptoms: Workflow triggers from unexpected repositories
Solution: Check that the repository field matches exactly (including owner/repo format). Verify you have access to the repository and that the webhook is configured on the correct repository.
Branch Mismatch
Symptoms: Workflow doesn't trigger on commits to expected branch
Solution: Verify the branch name is spelled correctly and matches the exact branch name in GitHub. Branch names are case-sensitive and must match exactly.
Webhook Authentication Errors
Symptoms: Webhook requests are rejected with authentication errors
Solution: Check that the webhook secret is correctly configured in both GitHub and your webhook endpoint. Verify the signature verification process is working correctly.
Missing Commit Data
Symptoms: Workflow starts but commit information is incomplete
Solution: Verify that the GitHub webhook payload contains the expected data structure. Check that the webhook is configured to send the full payload and not just a summary.
Related Resources
Webhook Node
Generic webhook trigger for custom integrations
Use the generic webhook node for custom GitHub integrations or other webhook-based triggers.
View Documentation →If-Else Node
Route workflow based on commit conditions
Use conditional logic to handle different types of commits or branch-specific workflows.
View Documentation →HTTP Request Node
Make API calls to GitHub or other services
Interact with GitHub API or other services based on commit information.
View Documentation →Node Library
Explore all available nodes
Discover other nodes to build comprehensive GitHub automation workflows.
View Documentation →