Skip to content

Commit

Permalink
Make sure that github token works in build script
Browse files Browse the repository at this point in the history
  • Loading branch information
theotherp committed Jan 22, 2024
1 parent ddc81fe commit 4dd05d2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions misc/build-and-release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ if (Test-Path "githubtoken.txt") {
$githubToken = Get-Content "githubtoken.txt"
$env:GITHUB_TOKEN = $githubToken
Write-Host "Github token is set"

$response = Invoke-WebRequest -Uri https://api.github.com -Method Head -Headers @{"Authorization" = "token $githubToken"}

if ($response.StatusCode -eq 200) {
Write-Host "GitHub token seems to be valid - HTTP status code is 200 OK"
} else {
Write-Error "GitHub token seems to be invalid - HTTP status code is $($response.StatusCode)"
exit 1
}
}

if ($discordToken -eq $null) {
Expand Down

0 comments on commit 4dd05d2

Please sign in to comment.