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
11 changes: 11 additions & 0 deletions src/main/java/org/kohsuke/github/GHWorkflowRun.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ public String toString() {
return name().toLowerCase(Locale.ROOT);
}
}
private GHUser actor;
private String artifactsUrl;
private String cancelUrl;
private String checkSuiteUrl;
Expand Down Expand Up @@ -307,6 +308,16 @@ public <T> T downloadLogs(InputStreamFunction<T> streamFunction) throws IOExcept
return root().createRequest().method("GET").withUrlPath(getApiRoute(), "logs").fetchStream(streamFunction);
}

/**
* The actor which triggered the initial run.
*
* @return the triggering actor
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected behavior")
public GHUser getActor() {
return actor;
}

/**
* The artifacts URL, like https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/artifacts
*
Expand Down
3 changes: 2 additions & 1 deletion src/test/java/org/kohsuke/github/GHWorkflowRunTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,8 @@ public void testManualRunAndBasicInformation() throws IOException {
assertThat(workflowRun.getStatus(), equalTo(Status.COMPLETED));
assertThat(workflowRun.getConclusion(), equalTo(Conclusion.SUCCESS));
assertThat(workflowRun.getHeadSha(), notNullValue());
assertThat(workflowRun.getTriggeringActor(), hasProperty("login", equalTo("octocat")));
assertThat(workflowRun.getActor(), hasProperty("login", equalTo("octocat")));
assertThat(workflowRun.getTriggeringActor(), hasProperty("login", equalTo("octocat_trigger")));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"cancel_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686034992/cancel",
"rerun_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686034992/rerun",
"workflow_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/workflows/6820790",
"triggering_actor": {
"actor": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
Expand All @@ -46,6 +46,26 @@
"type": "User",
"site_admin": false
},
"triggering_actor": {
"login": "octocat_trigger",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat_trigger",
"html_url": "https://github.com/octocat_trigger",
"followers_url": "https://api.github.com/users/octocat_trigger/followers",
"following_url": "https://api.github.com/users/octocat_trigger/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat_trigger/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat_trigger/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat_trigger/subscriptions",
"organizations_url": "https://api.github.com/users/octocat_trigger/orgs",
"repos_url": "https://api.github.com/users/octocat_trigger/repos",
"events_url": "https://api.github.com/users/octocat_trigger/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat_trigger/received_events",
"type": "User",
"site_admin": false
},
"head_commit": {
"id": "f6a5c19a67797d64426203b8a7a05a0fd74e5037",
"tree_id": "666bb9f951306171acb21632eca28a386cb35f73",
Expand Down