Add Bearer header for powershell script, make windows job match unix

This commit is contained in:
2024-10-03 14:45:53 -05:00
parent a9516faad4
commit fd18d14d1e
2 changed files with 16 additions and 2 deletions

View File

@@ -9,11 +9,20 @@ on:
jobs: jobs:
integration-windows: integration-windows:
runs-on: windows-latest strategy:
matrix:
include:
- os: windows-latest
runs-on: ${{ matrix.os }}
name: 'Integration (${{ matrix.os }})'
steps: steps:
- name: Run Integration - name: Run Integration
run: iex (irm "https://raw.githubusercontent.com/Xevion/spotify-player-quickauth/refs/heads/master/run.ps1") run: iex (irm "https://raw.githubusercontent.com/Xevion/spotify-player-quickauth/refs/heads/master/run.ps1")
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
integration-unix: integration-unix:
strategy: strategy:

View File

@@ -29,7 +29,12 @@ $REPO = "Xevion/spotify-player-quickauth"
$API_URL = "https://api.github.com/repos/$REPO/releases/latest" $API_URL = "https://api.github.com/repos/$REPO/releases/latest"
try { try {
$response = Invoke-RestMethod -Uri $API_URL $headers = @{}
if ($env:GH_TOKEN) {
$headers["Authorization"] = "Bearer $($env:GH_TOKEN)"
}
$response = Invoke-RestMethod -Uri $API_URL -Method Get -Headers $headers
} catch { } catch {
Write-Host "Failed to fetch API response: $_" Write-Host "Failed to fetch API response: $_"
exit 1 exit 1