#46625·renovate

postUpgradeTasks changes are dropped when a branch has duplicate updatedArtifacts entries for the same path

Author: RahulGautamSinghCreated Oct 1, 2026Updated Oct 1, 2026
Labelspriority-3-mediumworker:branch

Describe the proposed change(s).

Discussed in #42729.

When several updateArtifacts() calls in one branch return the same file, updatedArtifacts holds more than one entry for that path. Any change a postUpgradeTasks command makes to that file is then lost from the commit, even though Renovate logs Post-upgrade file saved.

Cause

  1. processUpdateArtifactResults() - pushes every returned file, so the same path can appear more than once

  2. postUpgradeCommandsExecutor() - writes every entry to disk before running the tasks, then refreshes only the first matching entry with updatedArtifacts.find()

  3. prepareCommit() - writes the entries in order, so the last entry, which still holds the content from before the task ran, overwrites the updated one

Affected ecosystems

Reported in the discussion for:

  • NuGet with Central Package Management, where several package files regenerate the same lock files
  • Go workspaces with gomodTidyAll, where dependentFiles returns go.mod and go.sum that the directly updated module already returned
  • uv workspaces, where each member pyproject.toml relocks the shared root uv.lock, and a grouped branch upgrades a different package in each member

Reproduction

Proposed fix

Remove duplicate entries where they are created. In processUpdateArtifactResults(), replace an existing entry with the same path instead of pushing a new one, so the last result wins. This matches what prepareCommit() commits today, and later steps never see two entries for one path.