Testing GH App for the Checks API
Use smee to get a webhook URL that you can use for testing. Follow the directions on the site to install the smee CLI locally if you haven't already.
Follow these steps to create a GitHub App. Use the URL generated from smee as the webhook URL. Save the changes and make sure to create a private key. Save this file somewhere you'll remember!
Clone this repo locally. Copy the .envconfig
file and name it .env
. For APP_GITHUB_APP_INTEGRATION_ID
, you'll use the App ID listed in the about information of your app on GitHub. For APP_GITHUB_APP_PRIVATE_KEY
, you'll use the contents of that pem file that you created earlier (replace the newlines with \n
and wrap the key with quotes).
Run make build && make run
.
Run smee -u <SMEE_URL> -t https://127.0.0.1:8080/api/github/hook
.
Make sure the app is installed to a repo of your choosing. Now you are set up!
In cmd/server/handlers.go
, add a struct that implements the githubapp.EventHandler
interface with your desired event. Initialize the handler in the initHandlers
function in main.go
.