GitHub Action Integration
Overview
The GitHub Action integration in Lamatic automates file monitoring and webhook triggering when files are modified in your repository. It supports various file types and provides secure integration with Lamatic Flow for automated processing and indexing.
This integration uses the Lamatic/[email protected]
GitHub Action to detect file changes and send them to your Lamatic Flow webhook for processing.
Features
Key Functionalities
- File Monitoring: Automatically detects when files are added or modified in specified paths
- Webhook Integration: Sends file contents to Lamatic Flow webhooks securely
- Security Features: Supports GitHub Secrets for secure credential management
- Flexible Configuration: Supports multiple file types and monitoring modes
Benefits
- Automates flow triggering based on repository changes
- Enables seamless integration with Lamatic Flow templates
- Provides robust configuration for selective file monitoring
- Supports both incremental and full-refresh synchronization modes
Available Functionality
Event Triggers
✅ File changes in specified paths (push events)
✅ Support for multiple file types (mdx, md, txt, etc.)
✅ Branch-specific monitoring
✅ Path-based filtering
Actions
✅ Send file contents to webhook
✅ Incremental and full-refresh modes
✅ Verbose logging for debugging
Prerequisites
Before setting up the GitHub Action integration, ensure you have:
- A GitHub repository with appropriate permissions
- A Lamatic Flow webhook endpoint configured
- Access to GitHub repository settings for managing secrets
- Understanding of GitHub Actions workflow configuration
Setup
Step 1: Set Up Lamatic Flow Webhook
- Create a Custom Flow: Follow the webhook integration guide (opens in a new tab) to create a flow that receives webhook data
- Note your webhook URL and key for the next steps
Step 2: Configure GitHub Secrets
- Navigate to your repository's Settings > Secrets and Variables > Actions
- Add the following repository secrets:
WEBHOOK_URL
: Your Lamatic Flow webhook URLWEBHOOK_KEY
: Your webhook authorization key (if required)
Keep your webhook credentials secure. Never commit them directly to your repository.
Step 3: Create GitHub Workflow
Create a workflow file in .github/workflows/
(e.g., lamatic-integration.yml
) with the following configuration:
name: Lamatic Integration
on:
push:
branches:
- main # Adjust to your default branch
paths:
- '**.mdx' # Monitor specific file types
jobs:
send-to-lamatic:
runs-on: ubuntu-latest
steps:
- name: Send File Changes to Lamatic
uses: Lamatic/[email protected]
with:
webhook_url: ${{ secrets.WEBHOOK_URL }}
webhook_key: ${{ secrets.WEBHOOK_KEY }}
github_ref: ${{ github.ref }}
file_type: "mdx"
mode: "incremental"
verbose: "true"
Check out more info for Lamatic Github Action here (opens in a new tab)
Configuration Reference
GitHub Action Parameters
Parameter | Description | Required | Default | Example |
---|---|---|---|---|
webhook_url | The URL of your Lamatic Flow webhook | ✅ | - | https://api.lamatic.ai/webhook/abc123 |
webhook_key | The authorization key for your webhook | ✅ | - | your_webhook_key |
github_ref | The GitHub reference (branch) to monitor | ✅ | - | refs/heads/main |
file_type | The file extension to detect and send | ✅ | - | mdx , md , txt |
mode | Synchronization mode: incremental or full-refresh | ✅ | incremental | incremental |
verbose | Enable verbose output for debugging | ❌ | false | true |
Usage Examples
Basic Integration
name: Basic Lamatic Integration
on:
push:
branches: [main]
paths: ['**.mdx']
jobs:
sync-files:
runs-on: ubuntu-latest
steps:
- name: Sync to Lamatic
uses: Lamatic/[email protected]
with:
webhook_url: ${{ secrets.WEBHOOK_URL }}
webhook_key: ${{ secrets.WEBHOOK_KEY }}
github_ref: ${{ github.ref }}
file_type: "mdx"
mode: "incremental"
Troubleshooting
Common Issues
Problem | Solution |
---|---|
Webhook Not Triggering | Verify webhook URL is correct and accessible from GitHub Actions |
File Changes Not Detected | Check the paths section matches your file structure and extensions |
Authorization Errors | Ensure WEBHOOK_KEY secret is correctly set and valid |
Workflow Not Running | Confirm the workflow file is in .github/workflows/ directory |
Verbose Mode Not Working | Set verbose: "true" and check GitHub Actions logs for detailed output |
Debugging Steps
- Check Workflow Logs: Navigate to your repository's Actions tab to view detailed logs
- Verify Webhook Endpoint: Test your webhook URL manually to ensure it's accessible
- Validate File Paths: Confirm the monitored file paths exist in your repository
- Check Branch Configuration: Ensure the monitored branches match your repository structure
Best Practices
- Use specific file paths to avoid unnecessary triggers
- Implement proper error handling in your Lamatic Flow
- Monitor GitHub Actions usage to stay within limits
- Regularly update the GitHub Action to the latest version
- Use descriptive workflow names for better organization