Skip to content

Commit 94e8cd0

Browse files
authored
Merge branch 'main' into add-worflow-run-query-builder
2 parents 06a2ea2 + 7c61987 commit 94e8cd0

File tree

5 files changed

+36
-4
lines changed

5 files changed

+36
-4
lines changed

.github/workflows/maven-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ jobs:
126126
name: maven-test-target-directory
127127
path: target
128128
- name: Codecov Report
129-
uses: codecov/codecov-action@v5.4.0
129+
uses: codecov/codecov-action@v5.4.3
130130
with:
131131
# Codecov token from https://app.codecov.io/gh/hub4j/github-api/settings
132132
token: ${{ secrets.CODECOV_TOKEN }}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@
475475
<plugin>
476476
<groupId>com.diffplug.spotless</groupId>
477477
<artifactId>spotless-maven-plugin</artifactId>
478-
<version>2.44.3</version>
478+
<version>2.44.5</version>
479479
<configuration>
480480
<java>
481481
<includes>

src/main/java/org/kohsuke/github/GHWorkflowRun.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ public String toString() {
207207
return name().toLowerCase(Locale.ROOT);
208208
}
209209
}
210+
private GHUser actor;
210211
private String artifactsUrl;
211212
private String cancelUrl;
212213
private String checkSuiteUrl;
@@ -307,6 +308,16 @@ public <T> T downloadLogs(InputStreamFunction<T> streamFunction) throws IOExcept
307308
return root().createRequest().method("GET").withUrlPath(getApiRoute(), "logs").fetchStream(streamFunction);
308309
}
309310

311+
/**
312+
* The actor which triggered the initial run.
313+
*
314+
* @return the triggering actor
315+
*/
316+
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected behavior")
317+
public GHUser getActor() {
318+
return actor;
319+
}
320+
310321
/**
311322
* The artifacts URL, like https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/artifacts
312323
*

src/test/java/org/kohsuke/github/GHWorkflowRunTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,8 @@ public void testManualRunAndBasicInformation() throws IOException {
610610
assertThat(workflowRun.getStatus(), equalTo(Status.COMPLETED));
611611
assertThat(workflowRun.getConclusion(), equalTo(Conclusion.SUCCESS));
612612
assertThat(workflowRun.getHeadSha(), notNullValue());
613-
assertThat(workflowRun.getTriggeringActor(), hasProperty("login", equalTo("octocat")));
613+
assertThat(workflowRun.getActor(), hasProperty("login", equalTo("octocat")));
614+
assertThat(workflowRun.getTriggeringActor(), hasProperty("login", equalTo("octocat_trigger")));
614615
}
615616

616617
/**

src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testManualRunAndBasicInformation/__files/6-r_h_g_actions_runs.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"cancel_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686034992/cancel",
2727
"rerun_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686034992/rerun",
2828
"workflow_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/workflows/6820790",
29-
"triggering_actor": {
29+
"actor": {
3030
"login": "octocat",
3131
"id": 1,
3232
"node_id": "MDQ6VXNlcjE=",
@@ -46,6 +46,26 @@
4646
"type": "User",
4747
"site_admin": false
4848
},
49+
"triggering_actor": {
50+
"login": "octocat_trigger",
51+
"id": 1,
52+
"node_id": "MDQ6VXNlcjE=",
53+
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
54+
"gravatar_id": "",
55+
"url": "https://api.github.com/users/octocat_trigger",
56+
"html_url": "https://github.com/octocat_trigger",
57+
"followers_url": "https://api.github.com/users/octocat_trigger/followers",
58+
"following_url": "https://api.github.com/users/octocat_trigger/following{/other_user}",
59+
"gists_url": "https://api.github.com/users/octocat_trigger/gists{/gist_id}",
60+
"starred_url": "https://api.github.com/users/octocat_trigger/starred{/owner}{/repo}",
61+
"subscriptions_url": "https://api.github.com/users/octocat_trigger/subscriptions",
62+
"organizations_url": "https://api.github.com/users/octocat_trigger/orgs",
63+
"repos_url": "https://api.github.com/users/octocat_trigger/repos",
64+
"events_url": "https://api.github.com/users/octocat_trigger/events{/privacy}",
65+
"received_events_url": "https://api.github.com/users/octocat_trigger/received_events",
66+
"type": "User",
67+
"site_admin": false
68+
},
4969
"head_commit": {
5070
"id": "f6a5c19a67797d64426203b8a7a05a0fd74e5037",
5171
"tree_id": "666bb9f951306171acb21632eca28a386cb35f73",

0 commit comments

Comments
 (0)