diff --git a/github/WorkflowRun.py b/github/WorkflowRun.py index c0bac8a5..31338657 100644 --- a/github/WorkflowRun.py +++ b/github/WorkflowRun.py @@ -92,6 +92,14 @@ class WorkflowRun(github.GithubObject.CompletableGithubObject): self._completeIfNotSet(self._conclusion) return self._conclusion.value + @property + def workflow_id(self): + """ + :type: int + """ + self._completeIfNotSet(self._workflow_id) + return self._workflow_id.value + @property def url(self): """ @@ -245,6 +253,7 @@ class WorkflowRun(github.GithubObject.CompletableGithubObject): self._event = github.GithubObject.NotSet self._status = github.GithubObject.NotSet self._conclusion = github.GithubObject.NotSet + self._workflow_id = github.GithubObject.NotSet self._url = github.GithubObject.NotSet self._html_url = github.GithubObject.NotSet self._pull_requests = github.GithubObject.NotSet @@ -276,6 +285,8 @@ class WorkflowRun(github.GithubObject.CompletableGithubObject): self._status = self._makeStringAttribute(attributes["status"]) if "conclusion" in attributes: # pragma no branch self._conclusion = self._makeStringAttribute(attributes["conclusion"]) + if "workflow_id" in attributes: # pragma no branch + self._workflow_id = self._makeIntAttribute(attributes["workflow_id"]) if "url" in attributes: # pragma no branch self._url = self._makeStringAttribute(attributes["url"]) if "html_url" in attributes: # pragma no branch diff --git a/github/WorkflowRun.pyi b/github/WorkflowRun.pyi index 32b47934..8874e2f5 100644 --- a/github/WorkflowRun.pyi +++ b/github/WorkflowRun.pyi @@ -29,6 +29,8 @@ class WorkflowRun(CompletableGithubObject): @property def conclusion(self) -> str: ... @property + def workflow_id(self) -> int: ... + @property def url(self) -> str: ... @property def html_url(self) -> str: ... diff --git a/tests/WorkflowRun.py b/tests/WorkflowRun.py index 6526ccbe..75c11f8c 100644 --- a/tests/WorkflowRun.py +++ b/tests/WorkflowRun.py @@ -47,6 +47,7 @@ class WorkflowRun(Framework.TestCase): self.assertEqual(self.workflow_run.event, "pull_request") self.assertEqual(self.workflow_run.status, "completed") self.assertEqual(self.workflow_run.conclusion, "failure") + self.assertEqual(self.workflow_run.workflow_id, 1026390) self.assertEqual( self.workflow_run.url, "https://api.github.com/repos/PyGithub/PyGithub/actions/runs/148274629",