This is the webhook-script I'm using to download the artifacts from the GBA Pong repository and to upload them on my server - resulting in an archive of nighly builds.
I've added a Makefile and a Dockerfile for ruby.
So you can fire it up by just calling make build_image
and make run
afterwards in your terminal (asuming you got make
and docker
installed).
The ruby script code/src/index.rb
is the entrypoint. It has the routes for the artifact-serving - it just displays the content of FOLDER
and the route for the webhook which receives the JSON payload and downloads it to the FOLDER
.
The routine was created by losely following the official webhooks guide
In the .env
you will have to set FOLDER
to the folder the artifacts are saved to.
TOKEN
is your personal access token which you can get in your account settings.
And SECRET
is the secret that was set in the webhook configuration in the repository you are accessing.