GitHub Event API Server

A Server that bootstraps custom handlers for the GitHub Event API

GroupId

GroupId

com.github.shredder121
ArtifactId

ArtifactId

gh-event-api
Last Version

Last Version

0.5
Release Date

Release Date

Type

Type

jar
Description

Description

GitHub Event API Server
A Server that bootstraps custom handlers for the GitHub Event API
Project URL

Project URL

https://github.com/Shredder121/gh-event-api
Project Organization

Project Organization

Shredder121
Source Code Management

Source Code Management

https://github.com/Shredder121/gh-event-api.git

Download gh-event-api

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.shredder121/gh-event-api/ -->
<dependency>
    <groupId>com.github.shredder121</groupId>
    <artifactId>gh-event-api</artifactId>
    <version>0.5</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.shredder121/gh-event-api/
implementation 'com.github.shredder121:gh-event-api:0.5'
// https://jarcasting.com/artifacts/com.github.shredder121/gh-event-api/
implementation ("com.github.shredder121:gh-event-api:0.5")
'com.github.shredder121:gh-event-api:jar:0.5'
<dependency org="com.github.shredder121" name="gh-event-api" rev="0.5">
  <artifact name="gh-event-api" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.shredder121', module='gh-event-api', version='0.5')
)
libraryDependencies += "com.github.shredder121" % "gh-event-api" % "0.5"
[com.github.shredder121/gh-event-api "0.5"]

Dependencies

compile (4)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-web jar
com.fasterxml.jackson.datatype : jackson-datatype-jsr310 jar
com.fasterxml.jackson.module : jackson-module-paranamer jar 2.6.5
com.fasterxml.jackson.datatype : jackson-datatype-guava jar 2.6.5

provided (1)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.16.6

test (4)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-test jar
org.hamcrest : hamcrest-library jar
com.jayway.restassured : rest-assured jar 2.7.0
org.kohsuke : github-api jar 1.71

Project Modules

There are no modules declared in this project.

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.

Versions

Version
0.5
0.4
0.3
0.2
0.1