Handler for GitHub Webhooks
Go to file
Tiago Garcia 91cf0fd09c
Create LICENSE
Signed-off-by: Tiago Garcia <tiago.rgarcia@ua.pt>
2024-07-18 01:38:29 +01:00
src Change to CMake base 2024-07-15 00:08:29 +01:00
.gitignore Change to CMake base 2024-07-15 00:08:29 +01:00
CMakeLists.txt Change to CMake base 2024-07-15 00:08:29 +01:00
LICENSE Create LICENSE 2024-07-18 01:38:29 +01:00
README.md Change to CMake base 2024-07-15 00:08:29 +01:00

README.md

GitHub Webhook Handler

Simple C++ WebAPI to work with GitHub Webhooks

Currently creating a local copy of remote files on every push

Usage

Run prebuilt binary

Head over to the Releases Page and download the desired binary.

Run the application using your configuration file:

/path/to/gh-wh-handler.<arch> /path/to/config.json

You can see the config file format below.

Run from source

Install the dependencies:

Build the application:

cmake -S . -B build
cmake --build build

Run the application using your configuration file:

bin/gh-wh-handler.<arch> /path/to/config.json

Note: default config file path is /etc/gh-wh-handler/config.json

Config File

The configuration file should be a JSON file with the following format:

{
    "port": 8080,
    "repos": {
        "repo_full_name": {
            "branch": "target_branch",
            "files": {
                "remote_path": "local_path"
            }
        }
    },
    "tokens": {
        "repo_full_name": "github_token"
    },
    "actions": {
        "repo_full_name": [
            "command1",
            "command2"
        ]
    }
}

Endpoint

Currently, the only endpoint for the application is /update-files