diff --git a/Update/UpdateVersion.js b/Update/UpdateVersion.js index 1b5ff2e3..c44748eb 100644 --- a/Update/UpdateVersion.js +++ b/Update/UpdateVersion.js @@ -79,6 +79,18 @@ function extractReleaseNotes(body) { return match ? match[1].trim() : ""; } var CurrentNotes = extractReleaseNotes(String(process.argv[5] || "")); +// Editing a PR (including AI reviewers adding summaries on the author's behalf) must never bump the version; +// it may only refresh this PR's own entry. Versions are bumped on opened/synchronize runs. +if (eventAction === "edited") { + if (LastPR != CurrentPR) { + console.log("PR edited, but the latest version entry is not this PR's. Not bumping the version."); + process.exit(0); + } + if (NpmVersion != LastJSVersion) { + console.warn("PR edited and owns the latest entry, but package.json and XMOJ.user.js are out of sync; skipping the metadata refresh."); + process.exit(0); + } +} if (LastJSVersion != NpmVersion) { console.warn("Assuming you manually ran npm version."); } else if (!(LastPR == CurrentPR && NpmVersion == LastJSVersion)) {