Skip to content

Commit

Permalink
Add User-Agent to GH API call
Browse files Browse the repository at this point in the history
  • Loading branch information
MihaZupan committed Sep 4, 2024
1 parent d0f03f6 commit 6f4196d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Runner/Jobs/BackportJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ private async Task CreatePullRequestAsync(string token, string baseRepo, string
request.Headers.Accept.ParseAdd("application/vnd.github+json");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token);
request.Headers.Add("X-GitHub-Api-Version", "2022-11-28");
request.Headers.Add("User-Agent", "MihuBot");

request.Content = JsonContent.Create(new
{
Expand All @@ -67,7 +68,7 @@ private async Task CreatePullRequestAsync(string token, string baseRepo, string

using HttpResponseMessage response = await HttpClient.SendAsync(request, JobTimeout);

await UploadTextArtifactAsync("GithubResponse.json", await response.Content.ReadAsStringAsync(JobTimeout));
await UploadTextArtifactAsync("GithubResponse.txt", await response.Content.ReadAsStringAsync(JobTimeout));

response.EnsureSuccessStatusCode();
}
Expand Down

0 comments on commit 6f4196d

Please sign in to comment.