Skip to content

Commit

Permalink
Fix: Add missing Content-Type key in Invoke-RestMethod -Headers
Browse files Browse the repository at this point in the history
Fixes Powershell 7.4 which now expects either `Invoke-RestMethod -Headers @{ 'Content-type' = '...' }`  or `-ContentType` to be populated, or it would error with `The given key 'Content-Type' was not present in the dictionary.`. See:
- https://github.com/theohbrothers/docker-kubectl/actions/runs/7909389274/job/21590330176#step:3:1516
- https://github.com/theohbrothers/docker-terraform/actions/runs/7837925330/job/21388510328#step:3:636
  • Loading branch information
leojonathanoh committed Feb 16, 2024
1 parent a589139 commit f41534c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function Automerge-DockerImageVariantsPR {
'Accept' = 'application/vnd.github+json'
'Authorization' = "Bearer $env:GITHUB_TOKEN"
'X-GitHub-Api-Version' = '2022-11-28'
'Content-Type' = 'application/json'
}
"Will automerge PR" | Write-Host
if (!$WhatIfPreference) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function New-Release {
'Accept' = 'application/vnd.github+json'
'Authorization' = "Bearer $env:GITHUB_TOKEN"
'X-GitHub-Api-Version' = '2022-11-28'
'Content-Type' = 'application/json'
}
$owner = ({ git remote get-url origin } | Execute-Command) -replace 'https://github.com/([^/]+)/([^/]+)', '$1'
$project = ({ git remote get-url origin } | Execute-Command) -replace 'https://github.com/([^/]+)/([^/]+)', '$2' -replace '\.git$', ''
Expand Down

0 comments on commit f41534c

Please sign in to comment.