فهرست منبع

Update ReportDiff to add a Content-Type header (#54307)

Eric Erhardt 2 سال پیش
والد
کامیت
bbb7ab0e44
1فایلهای تغییر یافته به همراه5 افزوده شده و 2 حذف شده
  1. 5 2
      .github/workflows/ReportDiff.ps1

+ 5 - 2
.github/workflows/ReportDiff.ps1

@@ -2,9 +2,12 @@
 $changed = (select-string "nothing to commit" artifacts\status.txt).count -eq 0
 $changed = (select-string "nothing to commit" artifacts\status.txt).count -eq 0
 if (-not $changed) { return $changed }
 if (-not $changed) { return $changed }
 # Check if tracking issue is open/closed
 # Check if tracking issue is open/closed
-$Headers = @{ Authorization = 'token {0}' -f $ENV:GITHUB_TOKEN; };
+$Headers = @{
+    Authorization = 'token {0}' -f $ENV:GITHUB_TOKEN;
+    'Content-Type' = 'application/json'
+};
 $result = Invoke-RestMethod -Uri $issue
 $result = Invoke-RestMethod -Uri $issue
-if ($result.state -eq "closed") { 
+if ($result.state -eq "closed") {
  $json = "{ `"state`": `"open`" }"
  $json = "{ `"state`": `"open`" }"
  $result = Invoke-RestMethod -Method PATCH -Headers $Headers -Uri $issue -Body $json
  $result = Invoke-RestMethod -Method PATCH -Headers $Headers -Uri $issue -Body $json
 }
 }