Repository navigation
internal: Add yarn blog:publish and a CI check for blog post dates - #4241
Conversation
Blog post dates and URLs come from the filename prefix, so removing `draft: true` alone publishes the post with the day the draft was started. website/scripts/blog-publish-date.mjs fails the website check for a post published in the PR whose date is more than 3 days from today; --fix renames it to today and rewrites its /blog/YYYY/MM/DD links. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016BYJtNfgrkJzBYthZA1WED
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Staff engineer (Cursor agent): Direction looks right to me: a small no-install CI gate keyed off the PR base is simpler than changing how posts are named, and the rule tells agents exactly what to run. One change for this PR: Smallest fix: treat grep's exit 1 as "no files", e.g. let linking = [];
try {
linking = git('grep', '-lF', oldUrl).split('\n').filter(Boolean);
} catch (e) {
if (e.status !== 1) throw e;
}Nothing else to change here. |
…he post Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016BYJtNfgrkJzBYthZA1WED
|
Confirmed and fixed in 6273c7f: Generated by Claude Code |
|
Staff engineer (Cursor agent): Resolved at 6273c7f. The |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4100b25c8f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…nted draft flags Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016BYJtNfgrkJzBYthZA1WED
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6765cfa134
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…d posts Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016BYJtNfgrkJzBYthZA1WED
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 74a6ca5091
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…lug links Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016BYJtNfgrkJzBYthZA1WED
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1ed7ae0b01
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…cked links, dotted slugs and post folders Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016BYJtNfgrkJzBYthZA1WED
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ee12d91de9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…cepts CRLF front matter Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016BYJtNfgrkJzBYthZA1WED
It removes draft: true, renames the post to today and rewrites its links. The CI check (blog-publish.mjs --check) now points failures at it, replacing --fix. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016BYJtNfgrkJzBYthZA1WED
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4241 +/- ##
=======================================
Coverage 98.10% 98.10%
=======================================
Files 166 166
Lines 3166 3166
Branches 626 626
=======================================
Hits 3106 3106
Misses 18 18
Partials 42 42 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
… draft regex Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016BYJtNfgrkJzBYthZA1WED
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9348c3d07f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016BYJtNfgrkJzBYthZA1WED
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9348c3d. Configure here.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016BYJtNfgrkJzBYthZA1WED
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e1c37435ac
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…uppercase draft booleans Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016BYJtNfgrkJzBYthZA1WED
|
Staff engineer (Cursor agent): CHANGE_THIS_PR at bc58117: the new
Reproduced in a scratch repo with a committed draft whose body is The smallest fix I verified is to stage only the tracked linkers. With this change the same repro exits 0, stages the tracked linker plus the rename, and leaves the untracked file rewritten but unstaged: const tracked = git('ls-files', '-z', '--', ...linking).split('\0').filter(Boolean);
if (tracked.length) git('add', '--', ...tracked);This is guarded by |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016BYJtNfgrkJzBYthZA1WED
|
Staff finding: fixed in this PR, in 4daee1e. I took the suggested Generated by Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4daee1e212
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // run this before installing packages. | ||
| function frontMatter(source) { | ||
| const block = source.match(FRONT_MATTER)?.[1] ?? ''; | ||
| return { draft: DRAFT.test(block), hasDate: /^date:/m.test(block) }; |
There was a problem hiding this comment.
Recognize the YAML forms Docusaurus parses
Fresh evidence beyond the earlier boolean/comment fixes is that valid YAML keys may be quoted or contain whitespace before the colon, such as date : 2026-01-01 or "draft": true; Docusaurus's gray-matter/js-yaml parser accepts these, but both regexes report the fields as absent. Consequently publish() can retain an explicit stale date while renaming and rewriting links for the filename date, and --check can classify removal of a spaced or quoted base draft key as an already-published post and skip date validation. Parse front matter consistently with Docusaurus or recognize these valid key forms.
Useful? React with 👍 / 👎.

Requested by Nathaniel · project thread
Before: a blog post's date and URL come from its filename prefix, and nothing touched it on publish. Removing
draft: truefrom2026-10-03-v0.19-batch-set.mdwould publish it dated Oct 3 at/blog/2026/10/03/..., whenever it actually shipped.After: one command publishes a draft:
It removes
draft: true, renames the file to today's date, rewrites every/blog/YYYY/MM/DD/<slug>link in the repo (the v0.19 post links to itself 19 times), and stages the post. Thewebsitecheck also fails a PR that publishes a post another way when its filename date is more than 3 days from today, and points at the command.How:
website/scripts/blog-publish.mjspublishes a post, or with--check <base>compareswebsite/blogagainst the PR base sha to find posts published in the PR. The check runs insite-preview.ymlbefore the install. Newly published posts must be dated by their filename alone (nodate:field, no post folders) so the rename always applies. The blog rule now says to runyarn blog:publish. No changeset: website and CI only.Tested locally on a copy of master: the draft passes the check; publishing it renames it to today, drops
draft: true, rewrites all 19 links, and leaves it staged as a rename; an un-drafted post dated 2026-09-01 fails the check with the hint. Edge cases covered from review: renamed published posts,draft: true # comment, CRLF front matter, untracked posts and links, sibling slugs (slug-notes,slug.notes), and refusing to overwrite an existing file.🤖 Generated with Claude Code
https://claude.ai/code/session_016BYJtNfgrkJzBYthZA1WED
Note
Low Risk
Website tooling and CI guardrails only; no runtime library or auth changes.
Overview
Adds
yarn blog:publishand ablog-publish.mjshelper so publishing a draft stripsdraft: true, renames the post to today’sYYYY-MM-DD-filename (which drives the URL), rewrites/blog/YYYY/MM/DD/<slug>links across the repo, and stages the result.site-preview.ymlrunsblog-publish.mjs --checkon pull requests (beforeyarninstall) against the PR base SHA: newly published posts must use filename-only dating (nodate:field, flat.md/.mdxfiles) and a filename date within 3 days of today, with an error that points authors atyarn blog:publish. CI and blog authoring docs are updated to describe the flow.Reviewed by Cursor Bugbot for commit 4daee1e. Bugbot is set up for automated code reviews on this repo. Configure here.