diff options
| author | 2018-12-10 17:17:40 +0000 | |
|---|---|---|
| committer | 2018-12-10 17:17:40 +0000 | |
| commit | b696e4e8188d87956be997bf427c058db09042b3 (patch) | |
| tree | 084fe739d78f5f8fd41c23d3f54a011d29d0eee2 | |
| parent | Add type hint for Logging._queue (diff) | |
| signature | ||
Add basics of `status` event handling, mostly for use with continuous integration (github.py)
| -rw-r--r-- | modules/github.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/github.py b/modules/github.py index a265a0ce..4bd2c9a8 100644 --- a/modules/github.py +++ b/modules/github.py @@ -87,6 +87,8 @@ class Module(ModuleManager.BaseModule): outputs = self.delete(event, full_name, data) elif github_event == "release": outputs = self.release(event, full_name, data) + elif github_event == "status": + outputs = self.status(event, full_name, data) if outputs: for server, channel in targets: @@ -251,3 +253,11 @@ class Module(ModuleManager.BaseModule): author = utils.irc.bold(data["release"]["author"]["login"]) url = data["release"]["html_url"] return ["%s %s a release%s - %s" % (author, action, name, url)] + + def status(self, event, full_name, data): + context = data["context"] + state = data["state"] + url = data["target_url"] + commit = self._short_id(data["sha"]) + return ["[%s status] %s is '%s' - %s" % + (commit, context, state, url)] |
