fix: npm run fetch-changelog fails on a fresh clone - #694
Conversation
Signed-off-by: anshumancanrock <anshu.1239.as@gmail.com>
✅ Deploy Preview for project-hami ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughThe changelog script now creates the authors directory when needed and handles a missing ChangesChangelog author storage
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Anshumancanrock, windsonsea The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
What this PR does / why we need it:
This PR fixes
npm run fetch-changelog <version>failing on a fresh clone.It exits 1 on a clean checkout.
updateAuthorsJson()readschangelog/source/authors.jsonwithout checking it exists, and the catch re-throws, so
main()bails before anything getswritten, including
CHANGELOG.md.changelog/source/is gitignored and only generated by thechangelog plugin at build time, so it isn't there on a fresh clone or in CI.
The fix, in
updateAuthorsJson(): make the directory first, and start from an empty map whenauthors.jsonisn't there yet.Which issue(s) this PR fixes:
Fixes #693
Checklist:
npm run lintandnpm run format:checkpass (prettier run on the changed file via npx,repo deps aren't installed locally; markdownlint only covers
docs/,tutorials/,blog/)npm run buildsucceeds for bothenandzh(not run, this is a standalone releasescript and nothing in the Docusaurus build imports it)
git commit -s)Summary by CodeRabbit