• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
flymaster

flymaster

deploy

Public
Like
deploy
Home
Code
2
README.md
H
main.ts
Branches
1
Pull requests
Remixes
History
Environment variables
2
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
…
Viewing readonly version of main branch: v40
View latest version
README.md

Universal Git Repository Webhook (RSS + Tarball)

This webhook works with ANY git repository by using RSS feeds and tarballs. It fetches the latest commit from the repository's RSS feed, downloads the corresponding tarball, and deploys all non-dot files to the lifehub val.

How It Works

  1. RSS Feed: Fetches the repository's RSS feed ({repo_url}.rss)
  2. Latest Commit: Gets the most recent commit from the RSS feed
  3. Tarball Download: Downloads the tarball from {commit_link}.tar.gz
  4. File Extraction: Extracts all non-dot files from the tarball
  5. Lifehub Deployment: Creates/updates the lifehub val with all repository content

Setup

  1. Set the environment variable repo to any Git repository URL:

    repo=https://github.com/username/repository-name
    repo=https://gitlab.com/username/repository-name  
    repo=https://git.sr.ht/~username/repository-name
    repo=https://codeberg.org/username/repository-name
    repo=https://your-git-server.com/username/repository-name
    
  2. The webhook is automatically triggered when this val receives an HTTP request.

Supported Git Hosting Services

  • ✅ GitHub - Full support
  • ✅ GitLab - Full support
  • ✅ SourceHut - Full support
  • ✅ Codeberg - Full support
  • ✅ Bitbucket - Full support
  • ✅ Gitea/Forgejo - Full support
  • ✅ Self-hosted Git - Full support (if RSS feeds are enabled)
  • ✅ Any Git repository with RSS feeds - Full support

This approach works with virtually any Git hosting service that provides RSS feeds for commits.

API Response

Success Response

{ "success": true, "message": "Successfully deployed X files to lifehub val", "files": ["file1.js", "file2.md", ...], "repository": "https://github.com/username/repository-name", "commit": "Latest commit message", "commitLink": "https://github.com/username/repository-name/commit/abc123" }

Error Response

{ "error": "Failed to process repository", "details": "Detailed error message", "repository": "https://github.com/username/repository-name" }

Lifehub Val Features

The generated lifehub val includes:

  • File Access: Get specific files via ?file=filename query parameter
  • File Listing: GET request without parameters returns all files and metadata
  • Repository Metadata: Commit info, timestamps, and repository details
  • Helper Functions:
    • getFile(filename): Get content of a specific file
    • listFiles(): Get array of all file names
    • getMetadata(): Get repository and commit metadata
    • searchFiles(pattern): Search files by regex pattern
    • getFilesByExtension(ext): Get files by extension

Usage Examples

Trigger the webhook

# Regular webhook (uses 'repo' environment variable) curl https://your-val-url.web.val.run # Test with sample repository curl https://your-val-url.web.val.run/test

Access lifehub content

# Get file list and metadata curl https://lifehub-val-url.web.val.run # Get specific file curl https://lifehub-val-url.web.val.run?file=README.md

Use lifehub programmatically

import { getFile, listFiles, getMetadata, searchFiles } from "./lifehub"; // Get a specific file const readme = getFile("README.md"); // List all files const allFiles = listFiles(); // Get repository metadata const meta = getMetadata(); console.log(`Last commit: ${meta.lastCommit}`); // Search for files const jsFiles = searchFiles("\\.js$");

Features

  • Universal Compatibility: Works with any Git host that provides RSS feeds
  • Latest Commit Tracking: Always gets the most recent changes
  • Complete Repository: Downloads entire repository content via tarball
  • Non-Dot File Filtering: Automatically excludes hidden files and .git directory
  • Binary File Filtering: Automatically skips binary files
  • Rich Metadata: Includes commit information and timestamps
  • Comprehensive API: Full set of helper functions for accessing content

File Processing

  • Included: All text files that don't start with a dot
  • Excluded:
    • Dot files (.gitignore, .env, etc.)
    • .git directory and contents
    • Binary files (detected by null bytes)
    • Directory entries

Limitations

  • RSS Dependency: Requires the Git hosting service to provide RSS feeds
  • Public Repositories: Works best with public repositories (private repos may need authentication)
  • Tarball Format: Relies on standard .tar.gz tarball availability
  • Text Files Only: Binary files are automatically filtered out
  • File Names: Sanitized for Val Town compatibility

Error Handling

The webhook provides detailed error messages for common issues:

  • RSS feed not found or inaccessible
  • No commits found in RSS feed
  • Tarball download failures
  • Extraction errors
  • Invalid repository URLs

Environment Variables

  • repo: Git repository URL in HTTPS format (required)

Security Notes

  • Generated vals are set to "unlisted" privacy by default
  • No authentication required for webhook trigger
  • Repository must be publicly accessible or provide public RSS feeds
  • Binary files are automatically filtered out for security
  • Only non-dot files are included to avoid sensitive configuration files

Performance

  • Efficient: Downloads only the latest commit via tarball
  • Complete: Gets entire repository content in one request
  • Fast: No recursive API calls needed
  • Memory Efficient: Processes files individually during extraction
  • Scalable: Works with repositories of any size (within memory limits)
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.