Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
18 changes: 18 additions & 0 deletions src/github3/repos/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading