@@ -232,6 +232,28 @@ impl GithubClient {
232
232
. context ( "failed to retrieve job logs" ) ?;
233
233
Ok ( String :: from_utf8_lossy ( & body) . to_string ( ) )
234
234
}
235
+
236
+ pub async fn workflow_run_job (
237
+ & self ,
238
+ repo : & IssueRepository ,
239
+ job_id : u128 ,
240
+ ) -> anyhow:: Result < WorkflowRunJob > {
241
+ let url = format ! ( "{}/actions/jobs/{job_id}" , repo. url( & self ) ) ;
242
+ self . json ( self . get ( & url) )
243
+ . await
244
+ . context ( "failed to retrive workflow job run details" )
245
+ }
246
+
247
+ pub async fn repo_git_trees (
248
+ & self ,
249
+ repo : & IssueRepository ,
250
+ sha : & str ,
251
+ ) -> anyhow:: Result < GitTrees > {
252
+ let url = format ! ( "{}/git/trees/{sha}" , repo. url( & self ) ) ;
253
+ self . json ( self . get ( & url) )
254
+ . await
255
+ . context ( "failed to retrive git trees" )
256
+ }
235
257
}
236
258
237
259
#[ derive( Debug , serde:: Serialize ) ]
@@ -1240,6 +1262,11 @@ impl IssuesEvent {
1240
1262
#[ derive( Debug , serde:: Deserialize ) ]
1241
1263
struct PullRequestEventFields { }
1242
1264
1265
+ #[ derive( Debug , serde:: Deserialize ) ]
1266
+ pub struct WorkflowRunJob {
1267
+ pub head_sha : String ,
1268
+ }
1269
+
1243
1270
#[ derive( Clone , Debug , serde:: Deserialize ) ]
1244
1271
pub struct CommitBase {
1245
1272
pub sha : String ,
@@ -2829,6 +2856,12 @@ pub struct GitTreeObject {
2829
2856
pub sha : String ,
2830
2857
}
2831
2858
2859
+ #[ derive( Debug , serde:: Deserialize ) ]
2860
+ pub struct GitTrees {
2861
+ pub sha : String ,
2862
+ pub tree : Vec < GitTreeEntry > ,
2863
+ }
2864
+
2832
2865
#[ derive( Debug , serde:: Serialize , serde:: Deserialize ) ]
2833
2866
pub struct GitTreeEntry {
2834
2867
pub path : String ,
0 commit comments