/octoevents

API that listen to GitHub issue events from this repository

Primary LanguageJava

Octo Events - API

API that listen to GitHub issue events from some repository

webhook settings

How to run?

Here are some ways to run this app:

In Docker

It has a image hosted on Docker Hub: https://hub.docker.com/repository/docker/tatsumibruno/octoevents

docker run -p 8080:8080 tatsumibruno/octoevents:0.0.1

Inside IDE

  • Import maven project
  • Configure JDK 11
  • Right-click on Application class and Run/Debug.

CLI

*You gonna need Java 11 and Maven

With terminal inside project folder, follow this steps:

Compile fat jar file:

mvn package verify

Execute:

java -jar /target/octoevents-api-0.0.1-SNAPSHOT.jar

Configuring GitHub webhook with the API

Configure ngrok to forward your http port:

ngrok http 8080

Access your repository webhook settings:

webhook settings

Set your exposed URL (path /webhooks/events) and modify Content-Type to application/json:

webhook settings

Configure to listen just the issue events (and clear the others):

webhook settings

webhook settings

Add Webhook

webhook settings

Testing API

Create some issue and modify its state (e.g Edit, Close, Reopen)

webhook settings

Access http://localhost:8080/swagger-ui.html and execute the endpoint to get the events from created issue:

webhook settings

webhook settings

Or just use CURL:

curl -X GET "http://localhost:8080/issues/1/events" -H "accept: */*" | jq

Access to the database

H2 Console is exposed at http://localhost:8080/h2-console

JDBC URL: jdbc:h2:mem:octoevents
User Name: sa
Password: password