diff --git a/.github/workflows/renovate-test.yml b/.github/workflows/renovate-test.yml index d8285e2..042ce00 100644 --- a/.github/workflows/renovate-test.yml +++ b/.github/workflows/renovate-test.yml @@ -20,4 +20,39 @@ jobs: RENOVATE_REPOSITORIES: ${{ github.repository }} RENOVATE_BASE_BRANCHES: ${{ github.ref_name }} RENOVATE_USE_BASE_BRANCH_CONFIG: merge - LOG_LEVEL: "debug" + LOG_LEVEL: debug + LOG_FORMAT: json + LOG_FILE: /tmp/renovate.log + - name: Show pending updates + uses: actions/github-script@v6 + with: + script: | + const fs = require("fs/promises"); + const logFile = await fs.readFile("/tmp/renovate.log", { encoding: "utf-8" }); + const lines = logFile.split("\n"); + for (const line of lines) { + /** @type {{ msg: string, config: Record }} */ + const log = JSON.parse(line); + if (log.msg === "packageFiles with updates") { + for (const [manager, files] of Object.entries(log.config)) { + console.log(`\n--- MANAGER ${manager}`); + for (const file of files) { + console.log(`In ${file.packageFile}:`); + if (file.deps.some((d) => d.updates.length > 0)) { + for (const dep of file.deps) { + for (const update of dep.updates) { + console.log( + ` - "${dep.depName}" from ${dep.currentValue} to ${update.newVersion}` + ); + } + } + } else { + console.log(" No updates"); + } + } + } + return; + } + } + + console.log("No updates");