@@ -135,7 +135,7 @@ public static async Task<bool> RemoveRunnerFromRepo(string repoName, string orgG
135135 return response . IsSuccessStatusCode ;
136136 }
137137
138- public static async Task < GitHubApiWorkflowRun > GetJobInfoForOrg ( long stuckJobGithubJobId , string repoName , string orgGitHubToken )
138+ public static async Task < ( GitHubApiWorkflowRun Job , System . Net . HttpStatusCode StatusCode ) > GetJobInfoForOrg ( long stuckJobGithubJobId , string repoName , string orgGitHubToken )
139139 {
140140 using var request = CreateRequest ( HttpMethod . Get , $ "https://api.github.com/orgs/{ repoName } /actions/jobs/{ stuckJobGithubJobId } ", orgGitHubToken ) ;
141141 HttpResponseMessage response = await SharedClient . SendAsync ( request ) ;
@@ -144,13 +144,13 @@ public static async Task<GitHubApiWorkflowRun> GetJobInfoForOrg(long stuckJobGit
144144 string content = await response . Content . ReadAsStringAsync ( ) ;
145145 GitHubApiWorkflowRun responseObject = JsonSerializer . Deserialize < GitHubApiWorkflowRun > ( content ) ;
146146
147- return responseObject ;
147+ return ( responseObject , response . StatusCode ) ;
148148 }
149149 Log . Warning ( $ "Unable to get GH job info for { repoName } /{ stuckJobGithubJobId } : [{ response . StatusCode } ] { response . ReasonPhrase } ") ;
150150
151- return null ;
151+ return ( null , response . StatusCode ) ;
152152 }
153- public static async Task < GitHubApiWorkflowRun > GetJobInfoForRepo ( long stuckJobGithubJobId , string repoName , string orgGitHubToken )
153+ public static async Task < ( GitHubApiWorkflowRun Job , System . Net . HttpStatusCode StatusCode ) > GetJobInfoForRepo ( long stuckJobGithubJobId , string repoName , string orgGitHubToken )
154154 {
155155 using var request = CreateRequest ( HttpMethod . Get , $ "https://api.github.com/repos/{ repoName } /actions/jobs/{ stuckJobGithubJobId } ", orgGitHubToken ) ;
156156 HttpResponseMessage response = await SharedClient . SendAsync ( request ) ;
@@ -159,10 +159,10 @@ public static async Task<GitHubApiWorkflowRun> GetJobInfoForRepo(long stuckJobGi
159159 string content = await response . Content . ReadAsStringAsync ( ) ;
160160 GitHubApiWorkflowRun responseObject = JsonSerializer . Deserialize < GitHubApiWorkflowRun > ( content ) ;
161161
162- return responseObject ;
162+ return ( responseObject , response . StatusCode ) ;
163163 }
164164 Log . Warning ( $ "Unable to get GH job info for { repoName } /{ stuckJobGithubJobId } : [{ response . StatusCode } ] { response . ReasonPhrase } ") ;
165165
166- return null ;
166+ return ( null , response . StatusCode ) ;
167167 }
168168}
0 commit comments