diff --git a/scripts/set-version.ts b/scripts/set-version.ts index 150d3e1db7..bab21747bb 100644 --- a/scripts/set-version.ts +++ b/scripts/set-version.ts @@ -15,7 +15,7 @@ */ import { existsSync, readFileSync, writeFileSync } from "fs"; -import { join } from "path"; +import { join, posix } from "path"; import { execFileSync } from "child_process"; import { pathToFileURL } from "url"; import { CLI_SEMVER_PATTERN } from "./cli-options.ts"; @@ -259,7 +259,8 @@ export function missingChangelogArtifacts(version: string) { } export function changelogArtifacts(version: string) { - return [join("releases", `v${version}.md`), `docs/changelog.mdx#HyperFrames v${version}`]; + // Git paths are always slash-separated, including when release tooling runs on Windows. + return [posix.join("releases", `v${version}.md`), `docs/changelog.mdx#HyperFrames v${version}`]; } export function unreviewedChangelogArtifacts(version: string) { @@ -310,10 +311,11 @@ export function docsChangelogEntryHasGeneratedTodo(content: string, marker: stri export function releaseAllowedPaths(version: string) { return [ - ...PACKAGES.map((pkg) => join(pkg, "package.json")), - ...PLUGINS.map((plugin) => join(plugin, "plugin.json")), + // These values are compared with Git's slash-separated path output. + ...PACKAGES.map((pkg) => posix.join(pkg, "package.json")), + ...PLUGINS.map((plugin) => posix.join(plugin, "plugin.json")), "docs/changelog.mdx", - join("releases", `v${version}.md`), + posix.join("releases", `v${version}.md`), ]; }