Skip to content

Commit

Permalink
added run_started_at and run_attempt attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
goliaro committed Oct 26, 2022
1 parent 784a3ef commit 8e0c471
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions github/WorkflowRun.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ def head_sha(self):
self._completeIfNotSet(self._head_sha)
return self._head_sha.value

@property
def run_attempt(self):
"""
:type: integer
"""
self._completeIfNotSet(self._run_attempt)
return self._run_attempt.value

@property
def run_number(self):
"""
Expand All @@ -76,6 +84,14 @@ def event(self):
self._completeIfNotSet(self._event)
return self._event.value

@property
def run_started_at(self):
"""
:type: datetime.datetime
"""
self._completeIfNotSet(self._run_started_at)
return self._run_started_at.value

@property
def status(self):
"""
Expand Down Expand Up @@ -266,8 +282,10 @@ def _initAttributes(self):
self._id = github.GithubObject.NotSet
self._head_branch = github.GithubObject.NotSet
self._head_sha = github.GithubObject.NotSet
self._run_attempt = github.GithubObject.NotSet
self._run_number = github.GithubObject.NotSet
self._event = github.GithubObject.NotSet
self._run_started_at = github.GithubObject.NotSet
self._status = github.GithubObject.NotSet
self._conclusion = github.GithubObject.NotSet
self._workflow_id = github.GithubObject.NotSet
Expand All @@ -294,10 +312,15 @@ def _useAttributes(self, attributes):
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 "run_attempt" in attributes: # pragma no branch
self._run_attempt = self._makeIntAttribute(attributes["run_attempt"])
if "run_number" in attributes: # pragma no branch
self._run_number = self._makeIntAttribute(attributes["run_number"])
if "event" in attributes: # pragma no branch
self._event = self._makeStringAttribute(attributes["event"])
if "run_started_at" in attributes: # pragma no branch
assert attributes["run_started_at"] is None or isinstance(attributes["run_started_at"], (str, unicode)), attributes["run_started_at"]
self._run_started_at = self._makeDatetimeAttribute(attributes["run_started_at"])
if "status" in attributes: # pragma no branch
self._status = self._makeStringAttribute(attributes["status"])
if "conclusion" in attributes: # pragma no branch
Expand Down

0 comments on commit 8e0c471

Please sign in to comment.