Skip to content

Commit

Permalink
Add Content-Type to the GH PR api call (#8275)
Browse files Browse the repository at this point in the history
We were hitting an error caused by some recent GH changes. Based
on https://github.com/orgs/community/discussions/110246 you now
need to explicitly set Content-Type in the headers to avoid the error:

The given key 'Content-Type' was not present in the dictionary.
  • Loading branch information
weshaggard authored May 16, 2024
1 parent f305fc0 commit b9de042
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions eng/scripts/Verify-And-Merge-PRs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ param(

$ReadyForMerge = $true
$mergablePRs = @()
$headers = @{ }
$headers = @{ "Content-Type" = "text/json" }
$RetryCount = 5

if ($null -eq $ShouldMerge) {
$ShouldMerge = $null -ne $AuthToken;
}

if ($AuthToken) {
$headers = @{
$headers += @{
Authorization = "bearer $AuthToken"
}
}
Expand Down

0 comments on commit b9de042

Please sign in to comment.