diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 13892dcd..df338e9a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,17 +8,17 @@ jobs: strategy: matrix: python: - - { VERSION: "3.7", TOXENV: "py37", ALLOW_FAILURE: false } - - { VERSION: "3.8", TOXENV: "py38", ALLOW_FAILURE: false } - { VERSION: "3.9", TOXENV: "py39", ALLOW_FAILURE: false } - { VERSION: "3.10", TOXENV: "py310", ALLOW_FAILURE: false } - { VERSION: "3.11", TOXENV: "py311", ALLOW_FAILURE: false } + - { VERSION: "3.12", TOXENV: "py312", ALLOW_FAILURE: false } + - { VERSION: "3.13", TOXENV: "py313", ALLOW_FAILURE: false } - { - VERSION: "3.11", + VERSION: "3.13", TOXENV: "flake8,doclint,docs,commitlint", ALLOW_FAILURE: false, } - - { VERSION: "3.11", TOXENV: "docstrings", ALLOW_FAILURE: true } + - { VERSION: "3.13", TOXENV: "docstrings", ALLOW_FAILURE: true } - { VERSION: "pypy3.9", TOXENV: "pypy", ALLOW_FAILURE: false } steps: diff --git a/src/github3/repos/repo.py b/src/github3/repos/repo.py index 89e99e76..212c023a 100644 --- a/src/github3/repos/repo.py +++ b/src/github3/repos/repo.py @@ -1392,6 +1392,24 @@ def create_tree(self, tree, base_tree=None): json = self._json(self._post(url, data=data), 201) return self._instance_or_null(git.Tree, json) + @decorators.requires_auth + def create_dispatch_event(self, event_type, client_payload=None): + """Create a dispatch event for this repository. + + :param str event_type: + (required), webhook event name + :param client_payload: + (optional), information about the webhook that may be used by the + workflow + :returns: + True if successful, False otherwise + :rtype: + """ + url = self._build_url("dispatches", base_url=self._api) + data = {"event_type": event_type, "client_payload": client_payload} + self._remove_none(data) + return self._boolean(self._post(url, data=data), 204, 404) + @decorators.requires_auth def delete(self): """Delete this repository. diff --git a/tox.ini b/tox.ini index 0124dabe..283a7c23 100644 --- a/tox.ini +++ b/tox.ini @@ -81,7 +81,7 @@ commands = # rst-lint is really only valuable for non-Sphinx reStructuredText, see also: # https://github.com/twolfson/restructuredtext-lint/blob/65ce9d6c7768ef9135c1d3ee4a1ae8c7bf89d92f/README.rst#sphinx deps = - doc8 >= 0.10.1 + doc8 >= 0.10.1, != 1.1.2 proselint >= 0.13.0 pygments restructuredtext_lint