Files
renovate-test/scripts/renovate-check.ps1
T

29 lines
1.4 KiB
PowerShell
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Nur prüfen: Renovate läuft mit --platform=local direkt auf diesem Verzeichnis.
# Es werden keine Dateien geändert; das Ergebnis (gefundene Updates) landet im Log
# und als JSON-Report in .renovate-local\report.json.
. "$PSScriptRoot\lib.ps1"
Invoke-Main {
New-Item -ItemType Directory -Force -Path $StateDir | Out-Null
$reportPath = Join-Path $StateDir 'report.json'
$logLevel = Get-EnvOrDefault 'LOG_LEVEL' 'info'
Write-Step "Renovate $RenovateVersion – Dry-Run (lookup) auf $RootDir"
Invoke-Renovate @('--platform=local', '--dry-run=lookup', '--report-type=file', "--report-path=$reportPath") @{ LOG_LEVEL = $logLevel }
Write-Step 'Gefundene Updates:'
$report = [IO.File]::ReadAllText($reportPath) | ConvertFrom-Json
foreach ($repo in $report.repositories.PSObject.Properties.Value) {
foreach ($manager in $repo.packageFiles.PSObject.Properties) {
foreach ($file in $manager.Value) {
foreach ($dep in $file.deps) {
if (-not ($dep.PSObject.Properties.Name -contains 'updates')) { continue }
foreach ($update in $dep.updates) {
Write-Host " [$($manager.Name)] $($file.packageFile): $($dep.depName) $($dep.currentValue) -> $($update.newValue) ($($update.updateType))"
}
}
}
}
}
}