Caution
Buildbot no longer supports Python 2.7 on the Buildbot master.
2.5.14.9. GitHubStatusPush¶
from buildbot.plugins import reporters, util
context = Interpolate("bb/%(prop:buildername)s")
c['services'].append(reporters.GitHubStatusPush(token='githubAPIToken', context=context))
GitHubStatusPush
publishes a build status using GitHub Status API.
It requires txrequests package to allow interaction with GitHub REST API.
It requires a GitHub API token in order to operate.
You can create a token from your own GitHub - Profile - Applications - Register new application or use an external tool to generate one.
-
class
buildbot.plugins.reporters.
GitHubStatusPush
(token, context=None, generators=None, startDescription=None, endDescription=None, baseURL=None, verbose=False, builders=None)¶ - Parameters
token (string) – token used for authentication. (can be a Secret)
context (renderable string) – Passed to GitHub to differentiate between statuses. A static string can be passed or
Interpolate
for dynamic substitution. The default context isbuildbot/%(prop:buildername)s
.generators (list of IReportGenerator instances) – A list of report generators that will be used to generate reports to be sent by this reporter. Currently the reporter will consider only the report generated by the first generator.
startDescription (renderable string) – Custom start message (default: ‘Build started.’). This parameter is deprecated, use
generators
instead.endDescription (renderable string) – Custom end message (default: ‘Build done.’). This parameter is deprecated, use
generators
instead.baseURL (string) – specify the github api endpoint if you work with GitHub Enterprise
verbose (boolean) – if True, logs a message for each successful status push
builders (list) – only send update for specified builders. This parameter is deprecated, use
generators
instead.