.. bb:reporter:: GitHubStatusPush

GitHubStatusPush
++++++++++++++++

.. py:currentmodule:: buildbot.plugins.reporters

.. code-block:: python

    from buildbot.plugins import reporters, util

    context = Interpolate("bb/%(prop:buildername)s")
    c['services'].append(reporters.GitHubStatusPush(token='githubAPIToken', context=context))

:class:`GitHubStatusPush` publishes a build status using `GitHub Status API <http://developer.github.com/v3/repos/statuses>`_.

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 <https://github.com/settings/applications>`_ or use an external tool to generate one.

.. py:class:: GitHubStatusPush(token, context=None, generators=None, startDescription=None, endDescription=None, baseURL=None, verbose=False, builders=None)

    :param string token: token used for authentication. (can be a :ref:`Secret`)
    :type context: renderable string
    :param context: Passed to GitHub to differentiate between statuses.
        A static string can be passed or :class:`Interpolate` for dynamic substitution.
        The default context is ``buildbot/%(prop:buildername)s``.
    :type generators: list of IReportGenerator instances
    :param generators: 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.
    :type startDescription: renderable string
    :param startDescription: Custom start message (default: 'Build started.').
        This parameter is deprecated, use ``generators`` instead.
    :type endDescription: renderable string
    :param endDescription: Custom end message (default: 'Build done.').
        This parameter is deprecated, use ``generators`` instead.
    :param string baseURL: specify the github api endpoint if you work with GitHub Enterprise
    :param boolean verbose: if True, logs a message for each successful status push
    :param list builders: only send update for specified builders.
        This parameter is deprecated, use ``generators`` instead.

.. _txrequests: https://pypi.python.org/pypi/txrequests
