server

command module
v0.0.0-...-d61ab6c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2025 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Webhook Server

The webhook that listens for review requests from repositories with the tasuke app installed.

Development

This project is a standard Go project, so only Go is required for building and running the code. The database uses GCP Firestore, so you will need to have a GCP project with a default Firestore database initialized. Make sure you have logged-in to the gcloud CLI and then you can run the server on http://localhost:8080.

Because this is a webhook, we must also prepare it to be exposed to a GitHub app to listen to events. We use ngrok for exposing the server. If you don't have one already, register for a free ngrok account. The environment variables NGROK_AUTHTOKEN and NGROK_DOMAIN should be set to the auth token and domain for your account. We generally recommend using direnv and a .envrc file for managing local secrets (this repository .gitignores .envrc).

You will also need a GitHub app for development that is tied to your domain. Create a new GitHub app, setting the "Webhook URL" to https://your-ngrok-domain.ngrok-free.app/github-webhook (make sure to replace the host with your actual domain) and set any random string for the webhook secret. Download a private key for the app. Set the environment variables GITHUB_APPID, GITHUB_SECRET, and GITHUB_PRIVATEKEYBASE64 to the application ID of the app, the secret string you defined, and the base64-encoding of the private key file you downloaded.

Install the app to any test repository you have.

Then, run ngrok in a separate terminal.

go run ./build ngrok

Finally, start the webhook.

go run ./build start

VSCode users should open the repository itself as a workspace using File > Open workspace from file. If you install all recommended extensions, formatters and linters will be set up for easy development. You will also find a launch configuration for running the Webhook Server + ngrok.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
build module
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL