{"id":21002761,"url":"https://github.com/200ok-ch/gh-events","last_synced_at":"2025-05-15T00:31:34.174Z","repository":{"id":56874123,"uuid":"217009966","full_name":"200ok-ch/gh-events","owner":"200ok-ch","description":"Determine Github event types by their payload and translate them into textual representations","archived":false,"fork":false,"pushed_at":"2020-11-15T14:32:18.000Z","size":92,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-01T11:37:33.083Z","etag":null,"topics":["events","github","ruby","slack"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/200ok-ch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["200ok-ch"]}},"created_at":"2019-10-23T08:43:32.000Z","updated_at":"2020-11-15T14:32:20.000Z","dependencies_parsed_at":"2022-08-20T22:30:34.077Z","dependency_job_id":null,"html_url":"https://github.com/200ok-ch/gh-events","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/200ok-ch%2Fgh-events","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/200ok-ch%2Fgh-events/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/200ok-ch%2Fgh-events/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/200ok-ch%2Fgh-events/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/200ok-ch","download_url":"https://codeload.github.com/200ok-ch/gh-events/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225317118,"owners_count":17455373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["events","github","ruby","slack"],"created_at":"2024-11-19T08:19:52.572Z","updated_at":"2024-11-19T08:19:53.318Z","avatar_url":"https://github.com/200ok-ch.png","language":"Ruby","funding_links":["https://github.com/sponsors/200ok-ch"],"categories":[],"sub_categories":[],"readme":"# Github Events\n\nVia Webhooks Github can send a plethora of events, which can be used\nto facilitate all kinds of automation.\n\nThese events are _untyped_, meaning they clearly lack a property\n`type` to identify the type of event received. The rationale here\nmight be that one would have different webhook endpoints for each type\nof events. But maintaining lots of endpoints is cumbersome. When all\nthe events end up in one endpoint, this library helps by adding a\nproperty `type` to the event.\n\nAdditionally this library provides means of translating the plain\nevent (a deeply nested data structure serialized to JSON) into a human\nreadable textutal representation. Some functionality is wrapped in a\ncommand line utilites, for your convenience.\n\n\n## Installation\n\n### To use the command line utilities\n\nOr install it yourself as:\n\n    $ gem install gh-events\n\n### To use as a library in your own project\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'gh-events'\n```\n\nAnd then execute:\n\n    $ bundle\n\n\n## Usage\n\n### CLI Util\n\n#### Typing\n\nYou can use the command `gh-events` to list the types of events\nstored in JSON files.\n\n```\n% gh-events spec/fixtures/*.json\nevents/001.json: commit_comment\nevents/002.json: create\nevents/003.json: delete\nevents/004.json: deployment\nevents/005.json: deployment_status\nevents/006.json: fork\n...\n```\n\n#### Translating\n\nThe `gh-event2text` util will receive one event via stdin. Let's say\nyou have a github _commit_comment_ event stored in a file named\n`event.json`. With you can to this:\n\n```\n% cat event.json | gh-event2text\n\"[Codertocat/Hello-World] Codertocat commented on commit `6113728f27ae82c7b1a177c8d03f9e96e0adf246`\u003e: \\\"This is a really good change! :+1:\\\"\"\n```\n\nFor translating the event into its textual representation\n`gh-event2text` uses a dictionary. The dictionary can be given as an\nargument to `gh-event2text`, which can either be a name of a packaged\ndict (currently `plain` (default) or `slack`) or a path to a\ndictionary file.\n\nDictionary files are YAML files with ERB for templating. The playload\nis fed to the templates as nested Ruby OpenStructs. For an elaborate\nexample have a look at the dictionary for Slack.\n\nIf you write your own dictionary for other target systems, please\nconsider to contribute.\n\nTODO: elaborate on how the lookup of types works\n\n\n### Library\n\nTODO: add an example\n\n\n## References\n\n- https://developer.github.com/v3/activity/events/types/\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/200ok-ch/gh-events.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F200ok-ch%2Fgh-events","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F200ok-ch%2Fgh-events","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F200ok-ch%2Fgh-events/lists"}