Skip to content

Shredder121/gh-event-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gh-event-api Build Status Coverage Status

GitHub Event API Server

What it does

@SpringBootApplication // You can make a regular Spring Boot application
public class Application {

    public static void main(String... args) {
        // This starts your app alongside gh-event-api
        GHEventApiServer.start(Application.class, args);
    }

    @Bean // Declaring your handlers as Spring beans will bootstrap them
    public PushHandler pushHandler() {
        return payload -> {
            System.out.println("got payload: " + payload);
        };
    }

    @Bean // You can declare as many handlers as you want/need
    public PushHandler anotherPushHandler() {
        return payload -> {
            System.out.println("got payload: " + payload);
        };
    }

}

After bootstrapping, the server listens for GitHub events at the configured port. (With sane defaults, courtesy of Spring Boot)

Configuration

Since eventually it's a Spring Boot app, all common application properties for the included version apply.

Examples

There are a few reference implementations of GitHub Event API style webhooks.

GitHub Review Window which is operational, right now mainly on this repository.

SpringIssueMaster which is a POC, based on the behavior of the Spring Issuemaster user.