Sign inSign up

timoreymann/github-serve-flow

By timoreymann

Updated 6 months ago

Simple proxy to serve and unzip github actions artifacts

Image
Web servers
0

1.7K

timoreymann/github-serve-flow repository overview

github-serve-flow

LICENSE GitHub Actions GitHub Release

Zero-dependency Go HTTP server that serves GitHub Actions artifact files from a disk cache with rate limiting.

Features

  • Serves individual files from GitHub Actions artifact zips via HTTP
  • Automatic artifact download and disk caching with TTL and size-based eviction
  • Per-IP sliding window rate limiting
  • Owner allowlist for access control
  • Correct content-type detection
  • Client-side cache headers
  • Concurrent fetch deduplication

Requirements

  • Go 1.22+ (for build)
  • GitHub personal access token with actions:read scope
  • Docker (optional, for container deployment)

Installation

From source
go build -o github-serve-flow .
Docker
docker build -t github-serve-flow .
docker run -e GITHUB_TOKEN=ghp_... -e ALLOWED_OWNERS=your-org -p 8080:8080 github-serve-flow

Usage

Configuration

All configuration is via environment variables:

VariableRequiredDefaultDescription
GITHUB_TOKENYes-GitHub personal access token
ALLOWED_OWNERSYes-Comma-separated list of allowed GitHub owners
LISTEN_ADDRNo:8080Server listen address
CACHE_DIRNo$TMPDIR/github-serve-flowDisk cache directory
CACHE_TTLNo1hCache entry time-to-live
CACHE_MAX_SIZENo5GBMaximum cache size on disk
CLIENT_CACHE_MAX_AGENo3600Cache-Control max-age in seconds
RATE_LIMIT_WINDOWNo1mRate limit sliding window
RATE_LIMIT_MAXNo60Max requests per IP per window
Running
export GITHUB_TOKEN="ghp_your_token"
export ALLOWED_OWNERS="your-github-username"

go run .
Endpoints
GET /health
GET /{owner}/{repo}/actions/runs/{runId}/artifacts/{artifactName}/{filePath}

Example:

curl http://localhost:8080/your-org/your-repo/actions/runs/12345/artifacts/my-site/index.html

Contributing

I love your input! I want to make contributing to this project as easy and transparent as possible, whether it's:

  • Reporting a bug
  • Discussing the current state of the configuration
  • Submitting a fix
  • Proposing new features
  • Becoming a maintainer

To get started please read the Contribution Guidelines.

Development

Requirements
Test
make test
Build
make build
Coverage
make cover

Tag summary

Content type

Image

Digest

sha256:993aa348f

Size

8.8 MB

Last updated

6 months ago

docker pull timoreymann/github-serve-flow