Skip to content

Commit 92fcd2f

Browse files
committed
Skip redirect sources that already exist when cutting a release
The nav patch step in cut-release adds a dated sibling redirect for every /specification/draft/... entry, but it never checked whether that dated source was already present. When main already carries the <version>/ redirects, the loop appends a second copy of each source and Mintlify rejects the resulting docs.json for reusing a source path, which is exactly what broke the 2026-07-28 release PR. Track the existing sources in a set and skip any collision so the step is idempotent regardless of what main already contains. :house: Remote-Dev: homespace
1 parent bbcfe53 commit 92fcd2f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎.github/workflows/cut-release.yml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,19 @@ jobs:
164164
}
165165
// Draft-source redirects (pages that moved out of the draft tree)
166166
// get a dated sibling so the promoted version's URLs resolve too.
167+
// Skip any dated source already present: main may carry pre-cut
168+
// <version>/ redirects, and Mintlify rejects duplicate sources.
167169
const draftRedirects = (j.redirects ?? []).filter((r) =>
168170
r.source.startsWith('/specification/draft/'),
169171
);
172+
const sources = new Set((j.redirects ?? []).map((r) => r.source));
170173
for (const r of draftRedirects) {
174+
const source = r.source.replace('/specification/draft/', `/specification/${V}/`);
175+
if (sources.has(source)) continue;
176+
sources.add(source);
171177
j.redirects.push({
172178
...r,
173-
source: r.source.replace('/specification/draft/', `/specification/${V}/`),
179+
source,
174180
destination: r.destination
175181
.replaceAll('/specification/draft', `/specification/${V}`)
176182
.replaceAll('/docs/draft', `/docs/${V}`),

0 commit comments

Comments
 (0)