From 73b5ca7b34bbb3900792dbf825f2ef6357d388c0 Mon Sep 17 00:00:00 2001 From: Anso Date: Mon, 4 May 2026 14:20:46 -0400 Subject: [PATCH] fix(ci): create posts dir before writing scaffold output (#914) writeFileSync throws ENOENT when the parent directory does not exist in a freshly cloned website repo. Call mkdirSync with recursive:true on the posts dir before writing the file. --- .github/scripts/scaffold-release-post.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/scripts/scaffold-release-post.mjs b/.github/scripts/scaffold-release-post.mjs index 35ad36b7..5754add6 100644 --- a/.github/scripts/scaffold-release-post.mjs +++ b/.github/scripts/scaffold-release-post.mjs @@ -8,7 +8,7 @@ // workflow commits it directly to website main. No PR is created or required. import { execFileSync } from 'node:child_process' -import { readFileSync, writeFileSync, readdirSync, existsSync } from 'node:fs' +import { readFileSync, writeFileSync, readdirSync, existsSync, mkdirSync } from 'node:fs' import { join, dirname } from 'node:path' import { fileURLToPath } from 'node:url' @@ -387,6 +387,7 @@ function main() { console.log(newMeta) } } else { + mkdirSync(dirname(postPath), { recursive: true }) writeFileSync(postPath, post, 'utf8') writeFileSync(indexPath, newIndex, 'utf8') if (newMeta) writeFileSync(metaPath, newMeta, 'utf8')