gitlab-webhooks
Version, currently 0.2.06 versions
github.com/chussenot/gitlab-webhooks
Parsing all the JSON events from your Gitlab HTTP callbacks
Nothing has been indexed for 0.2.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
gitlab-webhooks:
github: chussenot/gitlab-webhooks
version: ~> 0.2.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.2.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
gitlab-webhooks.cr
GitLab can trigger events with well configured webhooks. When that event occurs, the source app makes an HTTP request to the URI configured for the webhook, you can use the Crystal HTTP class to manage that. The action taken may be anything... Common uses are to trigger builds with continuous integration systems or to notify deployments.
Installation
- Add the dependency to your
shard.yml:
dependencies:
gitlab-webhooks:
github: chussenot/gitlab-webhooks
version: 0.3.3
- Run
shards install
Usage
You just have to require the lib.
require "gitlab-webhooks"
The Crystal is new ... Crystal has downsides just like every other languages.
To relay the catched Gitlab events on hundreds of Ruby, Python libraries made
by thousands of open source contributors over the last decade or monitoring
systems like Prometheus. You can contribute and add your exemple in the
exemples folder.
HTTP requests
This Crystal exemple show you how to implement where all endpoints can catch some events, parse them and print the values of some attributes.
require "json"
require "http/server"
require "gitlab-webhooks"
server = HTTP::Server.new do |context|
if body = context.request.body
event : Gitlab::Event = Gitlab.event_from(JSON.parse(body).to_json.to_s)
puts event.commit.message
context.response.content_type = "text/plain"
context.response.print "Hello world!"
else
context.response.print "You didn't POST any data :("
end
end
server.bind_tcp 8080
puts "Listening on http://0.0.0.0:8080"
server.listen
Then you can curl the server with a sample file
curl -X POST --data @data.json http://localhost:8080/
References
- How to add a GitLab project hook documentation
- The Rake task to add a project hooks
- The Grape API endpoint implementation
Contributing
- Fork it (https://github.com/chussenot/gitlab-webhooks.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Clement - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.2.0- Tagged
- Apr 6, 2019
- Commit
c0f0f781c03d- Indexed
- not yet
Dependents
No indexed shard depends on this one yet.
Repository
github.com/chussenot/gitlab-webhooks
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 6