diff --git a/.github/workflows/e2e-publishing.yml b/.github/workflows/e2e-publishing.yml index 02a6b259..87316059 100644 --- a/.github/workflows/e2e-publishing.yml +++ b/.github/workflows/e2e-publishing.yml @@ -46,13 +46,25 @@ jobs: $xmlPath = Join-Path $HOME ".m2" "settings.xml" Get-Content $xmlPath | ForEach-Object { Write-Host $_ } - [xml]$xml = Get-Content $xmlPath - $servers = $xml.settings.servers.server - if (($servers[0].id -ne 'maven') -or ($servers[0].username -ne '${env.MAVEN_USERNAME}') -or ($servers[0].password -ne '${env.MAVEN_CENTRAL_TOKEN}')) { - throw "Generated XML file is incorrect" - } + $content = [System.IO.File]::ReadAllText($xmlPath) + $expected = @( + '' + ' false' + ' ' + ' ' + ' maven' + ' ${env.MAVEN_USERNAME}' + ' ${env.MAVEN_CENTRAL_TOKEN}' + ' ' + ' ' + '' + ) -join "`n" - if (($servers[1].id -ne 'gpg.passphrase') -or ($servers[1].passphrase -ne '${env.MAVEN_GPG_PASSPHRASE}')) { + if ($content -ne $expected) { + Write-Host "Expected settings.xml:" + $expected -split "`n" | ForEach-Object { Write-Host $_ } throw "Generated XML file is incorrect" }