mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 19:31:10 +00:00
Add name, display_title and path attributes to WorkflowRun (#2397)
This commit is contained in:
@@ -44,6 +44,14 @@ class WorkflowRun(github.GithubObject.CompletableGithubObject):
|
||||
self._completeIfNotSet(self._id)
|
||||
return self._id.value
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._name)
|
||||
return self._name.value
|
||||
|
||||
@property
|
||||
def head_branch(self):
|
||||
"""
|
||||
@@ -60,6 +68,22 @@ class WorkflowRun(github.GithubObject.CompletableGithubObject):
|
||||
self._completeIfNotSet(self._head_sha)
|
||||
return self._head_sha.value
|
||||
|
||||
@property
|
||||
def display_title(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._display_title)
|
||||
return self._display_title.value
|
||||
|
||||
@property
|
||||
def path(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._path)
|
||||
return self._path.value
|
||||
|
||||
@property
|
||||
def run_attempt(self):
|
||||
"""
|
||||
@@ -280,8 +304,11 @@ class WorkflowRun(github.GithubObject.CompletableGithubObject):
|
||||
|
||||
def _initAttributes(self):
|
||||
self._id = github.GithubObject.NotSet
|
||||
self._name = github.GithubObject.NotSet
|
||||
self._head_branch = github.GithubObject.NotSet
|
||||
self._head_sha = github.GithubObject.NotSet
|
||||
self._display_title = github.GithubObject.NotSet
|
||||
self._path = github.GithubObject.NotSet
|
||||
self._run_attempt = github.GithubObject.NotSet
|
||||
self._run_number = github.GithubObject.NotSet
|
||||
self._event = github.GithubObject.NotSet
|
||||
@@ -308,10 +335,16 @@ class WorkflowRun(github.GithubObject.CompletableGithubObject):
|
||||
def _useAttributes(self, attributes):
|
||||
if "id" in attributes: # pragma no branch
|
||||
self._id = self._makeIntAttribute(attributes["id"])
|
||||
if "name" in attributes: # pragma no branch
|
||||
self._name = self._makeStringAttribute(attributes["name"])
|
||||
if "head_branch" in attributes: # pragma no branch
|
||||
self._head_branch = self._makeStringAttribute(attributes["head_branch"])
|
||||
if "head_sha" in attributes: # pragma no branch
|
||||
self._head_sha = self._makeStringAttribute(attributes["head_sha"])
|
||||
if "display_title" in attributes: # pragma no branch
|
||||
self._display_title = self._makeStringAttribute(attributes["display_title"])
|
||||
if "path" in attributes: # pragma no branch
|
||||
self._path = self._makeStringAttribute(attributes["path"])
|
||||
if "run_attempt" in attributes: # pragma no branch
|
||||
self._run_attempt = self._makeIntAttribute(attributes["run_attempt"])
|
||||
if "run_number" in attributes: # pragma no branch
|
||||
|
||||
Reference in New Issue
Block a user