Integrations
GitHub Action

GitHub Action Integration

No sections found for this integration
The integration documentation may not have the expected structure

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

  1. Create a Custom Flow: Follow the webhook integration guide (opens in a new tab) to create a flow that receives webhook data
  2. Note your webhook URL and key for the next steps

Step 2: Configure GitHub Secrets

  1. Navigate to your repository's Settings > Secrets and Variables > Actions
  2. Add the following repository secrets:
    • WEBHOOK_URL: Your Lamatic Flow webhook URL
    • WEBHOOK_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

ParameterDescriptionRequiredDefaultExample
webhook_urlThe URL of your Lamatic Flow webhook-https://api.lamatic.ai/webhook/abc123
webhook_keyThe authorization key for your webhook-your_webhook_key
github_refThe GitHub reference (branch) to monitor-refs/heads/main
file_typeThe file extension to detect and send-mdx, md, txt
modeSynchronization mode: incremental or full-refreshincrementalincremental
verboseEnable verbose output for debuggingfalsetrue

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

ProblemSolution
Webhook Not TriggeringVerify webhook URL is correct and accessible from GitHub Actions
File Changes Not DetectedCheck the paths section matches your file structure and extensions
Authorization ErrorsEnsure WEBHOOK_KEY secret is correctly set and valid
Workflow Not RunningConfirm the workflow file is in .github/workflows/ directory
Verbose Mode Not WorkingSet verbose: "true" and check GitHub Actions logs for detailed output

Debugging Steps

  1. Check Workflow Logs: Navigate to your repository's Actions tab to view detailed logs
  2. Verify Webhook Endpoint: Test your webhook URL manually to ensure it's accessible
  3. Validate File Paths: Confirm the monitored file paths exist in your repository
  4. 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

Related Resources

Was this page useful?

Questions? We're here to help

Subscribe to updates