Skip to content

Raku/geth

Repository files navigation

Geth

An IRC bot written in the Perl 6 programming language, to announce GitHub commits to various channels.

Webhook Endpoint

The webhook endpoint is https://geth.svc.tyil.net/?chan=#perl6 where #perl6 is the channel to report the commits to. Multiple channels can be specified, separated with commas.

Commit Filters

To add commit filters stick a .pm6 file into commit-filters/ and make it contain 1 sub that takes 1 arg with a name.

  1. Return undefined value to signal that filter did not match;
  2. Return a False value to stop further processing of the event and do not send any response to IRC;
  3. Return a string to send it to IRC.

SourceHut

Put the URL of the sourcehut hook in a shell var:

hook_url=XXX

Create a token via the web UI and also put it in a var:

oauth_token=XXX

Look up the ID of the repo you're interested in with:

curl \
--oauth2-bearer "$oauth_token" \
-H 'Content-Type: application/json' \
-d '{"query": "{ me { repositories { results { id, name } } } }"}' \
https://git.sr.ht/query

Put it in a var:

repo_id=XXX

Then create a webhook with:

curl --oauth2-bearer "$oauth_token" -H 'Content-Type: application/json' -d "{"query": "mutation { createGitWebhook(config: { repositoryID: $repo_id url: \"$hook_url\" events:[GIT_POST_RECEIVE] query: \"query { webhook { event, ... on GitEvent { repository { name, owner { canonicalName } } updates { ref { name } old { id } new { id } log { results { id, diff, author { name, time } committer { name, time } message } } } } }}\" }) { id } }"}" https://git.sr.ht/query

About

GitHub Push Updates to IRC Bot

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages