GitHub Sync

Connect your GitHub account to sync template files directly from repositories. Changes pushed to GitHub can automatically update your templates.

Connecting GitHub

Prerequisites

  • A GitHub account
  • Admin role in your PDF Generator organization

Connection Steps

  1. Go to ProfileGitHub Settings
  2. Click Connect GitHub Account
  3. Authorize the PDF Generator OAuth application on GitHub
  4. You'll be redirected back — your account is now connected
GitHub connection settings

Connection Status

The GitHub icon in the editor toolbar uses color coding:

Icon ColorStatus
GreyGitHub not connected
Dark/BlackConnected, manual sync only
GreenConnected, auto-sync active

Configuring a Template for GitHub Sync

  1. Open your template in the editor
  2. Click the GitHub icon in the editor toolbar
  3. In the GitHub Sync modal, configure:
GitHub sync configuration
  • Repository — Select from your connected GitHub repos (format: owner/repo)
  • Path — The directory path within the repo containing your template files (e.g., templates/invoice/)
  • Branch — The branch to sync from (defaults to main)

Click Save to apply the configuration.

Manual Sync (Copy from GitHub)

When you want to pull the latest files from GitHub:

  1. Open your template in the editor
  2. Click the Download icon (only visible when a repo is configured)
  3. In the Copy from GitHub modal, review the files that will be synced
  4. Click Sync to start the transfer
Copy from GitHub modal

The sync runs as a background job. A progress indicator shows the status:

  • Queued — Job is waiting to start
  • Processing — Files are being fetched and copied
  • Completed — Sync finished successfully
  • Failed — An error occurred (check the error message)
Copy from GitHub modal Completed

Auto-Sync on Push (Webhooks)

Enable automatic synchronization so your templates update whenever you push to GitHub.

Enabling Auto-Sync

In the GitHub Sync modal:

  1. Check Enable automatic sync on GitHub pushes
  2. Save the configuration
  3. A webhook is automatically created on your GitHub repository
  4. The GitHub icon turns green to indicate auto-sync is active

How It Works

  1. You push changes to the configured branch on GitHub
  2. GitHub sends a webhook event to PDF Generator
  3. The webhook is verified using HMAC-SHA256 signature
  4. All templates linked to that repository/path are updated automatically
  5. No manual intervention needed

Disabling Auto-Sync

Uncheck the auto-sync option in the GitHub Sync modal. This removes the webhook from your repository and reverts to manual sync only.

Sync Behavior

What Gets Synced

All files in the configured repository path are synced:

  • .html, .css, .js files become template files
  • Images and other assets in the path are also copied

What Happens to Existing Files

Existing template files that match filenames from the repo are overwritten. Files in the template that don't exist in the repo are preserved.

File Structure

The directory structure from your repository is preserved in the template file tree. For example:

repo: templates/invoice/
├── header.html
├── index.html
├── footer.html
└── styles/
    └── invoice.css

becomes:

Template
├── header.html
├── index.html
├── footer.html
└── styles/
    └── invoice.css

Troubleshooting

IssueResolution
GitHub connection failsRe-authorize from Profile → GitHub Settings
Sync job stays queuedCheck that the repository exists and your account has access
Files not updatingVerify the branch name is correct and the path exists
Webhook not triggeringRe-save the auto-sync config to recreate the webhook
Permission deniedEnsure your GitHub account has read access to the repository

Next Steps