fix: make updater head interpolation PowerShell-safe

This commit is contained in:
vendoo-updater-build
2026-07-10 12:48:12 +00:00
parent bce6536a1c
commit 196919c5e5
2 changed files with 2 additions and 48 deletions
@@ -1,46 +0,0 @@
name: Patch Updater 3.4 Worker Head Interpolation
on:
push:
branches:
- feature/updater-3.4-lifecycle
permissions:
contents: write
concurrency:
group: patch-updater-34-worker-head
cancel-in-progress: false
jobs:
patch:
if: ${{ github.actor != 'github-actions[bot]' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: feature/updater-3.4-lifecycle
fetch-depth: 0
- name: Mehrdeutige Head-Interpolation reparieren
shell: python
run: |
from pathlib import Path
path = Path('scripts/updater/Vendoo.Updater.Worker34.ps1')
text = path.read_text(encoding='utf-8-sig')
count = text.count('$head:')
if count != 2:
raise SystemExit(f'Erwartet wurden exakt 2 $head:-Stellen, gefunden: {count}')
text = text.replace('$head:', '${head}:')
path.write_text(text, encoding='utf-8-sig', newline='\n')
- name: Patch committen und temporären Workflow entfernen
shell: bash
run: |
set -euo pipefail
rm -f .github/workflows/patch-updater34-worker-head.yml
git config user.name 'vendoo-updater-build'
git config user.email 'vendoo-updater-build@users.noreply.github.com'
git add --all
git commit -m 'fix: make updater head interpolation PowerShell-safe'
git push origin HEAD:feature/updater-3.4-lifecycle
+2 -2
View File
@@ -110,11 +110,11 @@ function Wait-RequiredGitHubChecks([string]$GhPath,[string]$PrUrl,$Session){
$runsResult=Invoke-External $GhPath @('api',"repos/$Repository/actions/runs?head_sha=$head&per_page=100")-TimeoutSeconds 90 -AllowFailure -Label 'Workflow-Runs des finalen Heads lesen' -Quiet;$runs=@();if($runsResult.Code-eq0-and$runsResult.Output.Trim()){try{$runs=@(($runsResult.Output|ConvertFrom-Json).workflow_runs)}catch{$runs=@()}}
$elapsed=[int]((Get-Date)-$headSince).TotalSeconds;$timedOut=(Get-Date)-ge$deadline;$classification=Invoke-Lifecycle 'classify-checks' ([ordered]@{checks=@($pr.statusCheckRollup);workflowRuns=$runs;elapsedSeconds=$elapsed;gracePeriodSeconds=90;timedOut=$timedOut})
$matrix=@($classification.rows|ForEach-Object{"$($_.name): $($_.state) ($($_.conclusion)$($_.status))"})-join'; '
if($matrix-ne$lastMatrix-or((Get-Date)-$script:LastCheckLog).TotalSeconds-ge30){Write-Event 'INFO' "GitHub-Status für $head: $matrix";$lastMatrix=$matrix;$script:LastCheckLog=Get-Date}
if($matrix-ne$lastMatrix-or((Get-Date)-$script:LastCheckLog).TotalSeconds-ge30){Write-Event 'INFO' "GitHub-Status für ${head}: $matrix";$lastMatrix=$matrix;$script:LastCheckLog=Get-Date}
if([string]$classification.state-eq'failed'){throw"Ein erforderlicher GitHub-Check ist fehlgeschlagen.`n$matrix"}
if([string]$classification.state-eq'timeout'){throw"Zeitlimit beim Warten auf GitHub-Checks für finalen Head $head.`n$matrix"}
if([string]$classification.state-eq'success'){$verify=(Invoke-External $GhPath @('pr','view',$PrUrl,'--repo',$Repository,'--json','headRefOid')-TimeoutSeconds 60 -Label 'Finalen PR-Head bestätigen' -Quiet).Output|ConvertFrom-Json;if([string]$verify.headRefOid-eq$head){return[pscustomobject]@{Merged=$false;HeadSha=$head;Pr=$pr}};Write-Event 'INFO' 'PR-Head änderte sich nach erfolgreicher Check-Auswertung; Auswertung wird für den neuen Head wiederholt.'}
Write-State 80 'GitHub-Checks' "Finaler Head $head: $($classification.reason).";Start-Sleep -Seconds 10
Write-State 80 'GitHub-Checks' "Finaler Head ${head}: $($classification.reason).";Start-Sleep -Seconds 10
}
}
function Ensure-Deployment($Session){