mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-02 03:41:08 +00:00
Add method to delete Workflow runs (#2078)
One piece of missing functionality is the ability to delete Workflow Runs, which the GitHub API supports. Add a delete() method to WorkflowRun. Fixes #2019
This commit is contained in:
@@ -243,6 +243,14 @@ class WorkflowRun(github.GithubObject.CompletableGithubObject):
|
||||
timingdata = namedtuple("TimingData", data.keys())
|
||||
return timingdata._make(data.values())
|
||||
|
||||
def delete(self):
|
||||
"""
|
||||
:calls: `DELETE /repos/{owner}/{repo}/actions/runs/{run_id} <https://docs.github.com/en/rest/reference/actions#workflow-runs>`_
|
||||
:rtype: bool
|
||||
"""
|
||||
status, _, _ = self._requester.requestJson("DELETE", self.url)
|
||||
return status == 204
|
||||
|
||||
def _initAttributes(self):
|
||||
self._id = github.GithubObject.NotSet
|
||||
self._head_branch = github.GithubObject.NotSet
|
||||
|
||||
Reference in New Issue
Block a user