René's URL Explorer Experiment


Title: chore: 添加 CHANGELOG 自动生成、发布工作流及预提交检查优化 by hqwlkj · Pull Request #208 · lessweb/deepcode-cli · GitHub

Open Graph Title: chore: 添加 CHANGELOG 自动生成、发布工作流及预提交检查优化 by hqwlkj · Pull Request #208 · lessweb/deepcode-cli

X Title: chore: 添加 CHANGELOG 自动生成、发布工作流及预提交检查优化 by hqwlkj · Pull Request #208 · lessweb/deepcode-cli

Description: Description 本 PR 为项目引入了一套自动化的 CHANGELOG 生成与发布流程,并优化了预提交检查机制。 变更内容 1. CHANGELOG 自动生成 (scripts/generate-changelog.js) 新增脚本,从 GitHub Releases API 拉取所有稳定版本(vX.Y.Z),自动生成 CHANGELOG.md 按 Keep a Changelog 规范分组(Added / Changed / Fixed / Performance / Documentation / Other)——根据 PR 标题的 conventional commit 前缀(feat: → Added, fix: → Fixed 等)自动归类 自动过滤 chore(release) 类噪音条目,跳过低版本(pre-release / nightly) 支持 --dry-run 输出到 stdout、--repo 指定仓库、--output 指定输出路径 配套 214 行单元测试(scripts/tests/generate-changelog.test.js),覆盖 categorize、parseReleaseEntries、buildChangelog 等纯函数 2. 发布工作流自动化 (.github/workflows/release.yml) 新增 GitHub Actions 工作流:当推送 v* tag 时自动触发 自动创建 GitHub Release(gh release create --generate-notes) 自动生成并提交更新后的 CHANGELOG.md 3. 预提交检查优化 .husky/pre-commit:从直接调用 npx lint-staged 改为通过 npm run pre-commit 调用,失败时提供友好提示(含 --no-verify 应急方案) scripts/pre-commit.js:通过 lint-staged API 直接运行,在 git 仓库根目录下执行,仅处理暂存区文件 4. CI 增强 (.github/workflows/ci.yml) 在 test job 中新增 npm run test:scripts 步骤,确保脚本测试在 CI 中执行 5. 新增 npm scripts (package.json) Script 用途 npm run changelog 执行 scripts/generate-changelog.js 生成 CHANGELOG npm run test:scripts 运行 scripts/__tests__/*.test.js 测试 npm run pre-commit 运行 scripts/pre-commit.js 预提交检查 文件变更一览 .github/workflows/ci.yml | 3 + .github/workflows/release.yml | 51 ++++ .husky/pre-commit | 10 +- CHANGELOG.md | 183 ++++++++++++++ package.json | 5 +- scripts/__tests__/generate-changelog.test.js | 214 +++++++++++++++++ scripts/generate-changelog.js | 314 ++++++++++++++++++++++++ scripts/pre-commit.js | 25 +++ 8 files changed, 803 insertions(+), 2 deletions(-) 如何验证 # 1. 脚本单元测试 npm run test:scripts # 2. 预提交检查(修改任意文件后暂存) git add npm run pre-commit # 3. CHANGELOG 生成(需要 gh CLI 已认证) npm run changelog -- --dry-run # 预览输出

Open Graph Description: Description 本 PR 为项目引入了一套自动化的 CHANGELOG 生成与发布流程,并优化了预提交检查机制。 变更内容 1. CHANGELOG 自动生成 (scripts/generate-changelog.js) 新增脚本,从 GitHub Releases API 拉取所有稳定版本(vX.Y.Z),自动生成 CHANGELOG.md 按 Keep a Changelog...

X Description: Description 本 PR 为项目引入了一套自动化的 CHANGELOG 生成与发布流程,并优化了预提交检查机制。 变更内容 1. CHANGELOG 自动生成 (scripts/generate-changelog.js) 新增脚本,从 GitHub Releases API 拉取所有稳定版本(vX.Y.Z),自动生成 CHANGELOG.md 按 Keep a Changelog...

Opengraph URL: https://github.com/lessweb/deepcode-cli/pull/208

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:90261c1c-05ba-6c04-596e-a1692b3364fc
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idEC1E:1138FF:2419BC:30A682:6A4D33AE
html-safe-nonce7195583c40b855d370df268195b62c150db4f720833f4e310358fc8e2c13688b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzFFOjExMzhGRjoyNDE5QkM6MzBBNjgyOjZBNEQzM0FFIiwidmlzaXRvcl9pZCI6Ijc1NTY5NTUzMjk0MzIyMDQyMDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacbcbd20969bddf12afccf15b6624672220ab1958378937cf33818352897c73efc
hovercard-subject-tagpull_request:3952835540
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/lessweb/deepcode-cli/pull/208/files
twitter:imagehttps://avatars.githubusercontent.com/u/12181423?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/12181423?s=400&v=4
og:image:altDescription 本 PR 为项目引入了一套自动化的 CHANGELOG 生成与发布流程,并优化了预提交检查机制。 变更内容 1. CHANGELOG 自动生成 (scripts/generate-changelog.js) 新增脚本,从 GitHub Releases API 拉取所有稳定版本(vX.Y.Z),自动生成 CHANGELOG.md 按 Keep a Changelog...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/lessweb/deepcode-cli git https://github.com/lessweb/deepcode-cli.git
octolytics-dimension-user_id118287711
octolytics-dimension-user_loginlessweb
octolytics-dimension-repository_id1223512305
octolytics-dimension-repository_nwolessweb/deepcode-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1223512305
octolytics-dimension-repository_network_root_nwolessweb/deepcode-cli
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release56fc8347865a14e2ec811533d68f929cf4e0ec19
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/lessweb/deepcode-cli/pull/208/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Flessweb%2Fdeepcode-cli%2Fpull%2F208%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Flessweb%2Fdeepcode-cli%2Fpull%2F208%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=lessweb%2Fdeepcode-cli
Reloadhttps://github.com/lessweb/deepcode-cli/pull/208/files
Reloadhttps://github.com/lessweb/deepcode-cli/pull/208/files
Reloadhttps://github.com/lessweb/deepcode-cli/pull/208/files
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/208/files
lessweb https://github.com/lessweb
deepcode-clihttps://github.com/lessweb/deepcode-cli
Notifications https://github.com/login?return_to=%2Flessweb%2Fdeepcode-cli
Fork 150 https://github.com/login?return_to=%2Flessweb%2Fdeepcode-cli
Star 1.7k https://github.com/login?return_to=%2Flessweb%2Fdeepcode-cli
Code https://github.com/lessweb/deepcode-cli
Issues 43 https://github.com/lessweb/deepcode-cli/issues
Pull requests 22 https://github.com/lessweb/deepcode-cli/pulls
Actions https://github.com/lessweb/deepcode-cli/actions
Projects https://github.com/lessweb/deepcode-cli/projects
Security and quality 0 https://github.com/lessweb/deepcode-cli/security
Insights https://github.com/lessweb/deepcode-cli/pulse
Code https://github.com/lessweb/deepcode-cli
Issues https://github.com/lessweb/deepcode-cli/issues
Pull requests https://github.com/lessweb/deepcode-cli/pulls
Actions https://github.com/lessweb/deepcode-cli/actions
Projects https://github.com/lessweb/deepcode-cli/projects
Security and quality https://github.com/lessweb/deepcode-cli/security
Insights https://github.com/lessweb/deepcode-cli/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Flessweb%2Fdeepcode-cli%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Flessweb%2Fdeepcode-cli%2Fissues%2Fnew%2Fchoose
hqwlkjhttps://github.com/hqwlkj
lessweb:mainhttps://github.com/lessweb/deepcode-cli/tree/main
hqwlkj:feature/changeloghttps://github.com/hqwlkj/deepcode-cli/tree/feature/changelog
Conversation 0 https://github.com/lessweb/deepcode-cli/pull/208
Commits 11 https://github.com/lessweb/deepcode-cli/pull/208/commits
Checks 6 https://github.com/lessweb/deepcode-cli/pull/208/checks
Files changed https://github.com/lessweb/deepcode-cli/pull/208/files
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/208/files
chore: 添加 CHANGELOG 自动生成、发布工作流及预提交检查优化 https://github.com/lessweb/deepcode-cli/pull/208/files#top
Show all changes 11 commits https://github.com/lessweb/deepcode-cli/pull/208/files
1f431ea chore(scripts): 添加生成CHANGELOG.md的脚本 hqwlkj Jun 24, 2026 https://github.com/lessweb/deepcode-cli/pull/208/commits/1f431ea15f682b9e16badbf6e4aed717172d42bb
004ab3e Merge branch 'main' into feature/changelog hqwlkj Jun 25, 2026 https://github.com/lessweb/deepcode-cli/pull/208/commits/004ab3e4e5b1a45601f709a23302d0602a104cfe
78b618d ci(workflow): 添加脚本测试与改进预提交检查 hqwlkj Jun 25, 2026 https://github.com/lessweb/deepcode-cli/pull/208/commits/78b618d7103814c49eaa98f743713af7382f113f
439f1eb ci(release): 添加发布工作流自动化脚本 hqwlkj Jun 25, 2026 https://github.com/lessweb/deepcode-cli/pull/208/commits/439f1eb45d77b8ab6d3ebf23ddd23774da20f0bc
fb87dea Merge branch 'main' into feature/changelog hqwlkj Jun 26, 2026 https://github.com/lessweb/deepcode-cli/pull/208/commits/fb87dea04130952c98ad8ab9b7400f23b49026c9
5b20fb2 chore(changelog): 更新CHANGELOG格式及生成脚本 hqwlkj Jun 26, 2026 https://github.com/lessweb/deepcode-cli/pull/208/commits/5b20fb2dd1b8937c8d0e424f0432a2200013fe8a
591274a chore(changelog): 更新CHANGELOG格式及生成脚本 hqwlkj Jun 26, 2026 https://github.com/lessweb/deepcode-cli/pull/208/commits/591274a9f9281d197847e9cb883f6daf113e7dce
c18d0d8 refactor(ui): 替换所有 process.stdout.write 为统一的写入方法 hqwlkj Jun 26, 2026 https://github.com/lessweb/deepcode-cli/pull/208/commits/c18d0d81cadda282677190ef31c80fa473522a8d
7723ddd Merge branch 'lessweb:main' into main hqwlkj Jun 26, 2026 https://github.com/lessweb/deepcode-cli/pull/208/commits/7723ddd58203d5f315cf1fa83f0339a83934ce6e
dc6f560 Merge branch 'main' into feature/changelog hqwlkj Jun 29, 2026 https://github.com/lessweb/deepcode-cli/pull/208/commits/dc6f560c06b85818c8a4197a6a1d013e9b842133
b3ea1d5 chore(scripts): 支持无PR链接的变更条目标记解析与格式化 hqwlkj Jun 29, 2026 https://github.com/lessweb/deepcode-cli/pull/208/commits/b3ea1d5a8592c56e63e909d3f9cebcb4253b217a
Clear filters https://github.com/lessweb/deepcode-cli/pull/208/files
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/208/files
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/208/files
ci.yml https://github.com/lessweb/deepcode-cli/pull/208/files#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03f
release.yml https://github.com/lessweb/deepcode-cli/pull/208/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34
pre-commit https://github.com/lessweb/deepcode-cli/pull/208/files#diff-d2bc4bbf14eadc292d84e0ef5f7a93115c23557f533809fc80b896934291529d
CHANGELOG.md https://github.com/lessweb/deepcode-cli/pull/208/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
package.json https://github.com/lessweb/deepcode-cli/pull/208/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519
App.tsx https://github.com/lessweb/deepcode-cli/pull/208/files#diff-85bb709e32daf446ca90dc746b77c6d1cf092ec6a70d6471ec26786047093dfe
generate-changelog.test.js https://github.com/lessweb/deepcode-cli/pull/208/files#diff-fee9277995992e469ae3b0572ed3047b35f60ae57135b9555a2fdce50626b39b
generate-changelog.js https://github.com/lessweb/deepcode-cli/pull/208/files#diff-4a3bde22066c7a7e045d73b2930bb9ae81620d75717f34f6c0e1f47fbdbf6201
pre-commit.js https://github.com/lessweb/deepcode-cli/pull/208/files#diff-c8a4056cc7ab42285f9f6b4a1c48930cef6bb38be2066f27200ad3344d24f7d4
.github/workflows/ci.ymlhttps://github.com/lessweb/deepcode-cli/pull/208/files#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03f
View file https://github.com/lessweb/deepcode-cli/blob/b3ea1d5a8592c56e63e909d3f9cebcb4253b217a/.github/workflows/ci.yml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/lessweb/deepcode-cli/pull/208/{{ revealButtonHref }}
https://github.com/lessweb/deepcode-cli/pull/208/files#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03f
.github/workflows/release.ymlhttps://github.com/lessweb/deepcode-cli/pull/208/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34
View file https://github.com/lessweb/deepcode-cli/blob/b3ea1d5a8592c56e63e909d3f9cebcb4253b217a/.github/workflows/release.yml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/lessweb/deepcode-cli/pull/208/{{ revealButtonHref }}
.husky/pre-commithttps://github.com/lessweb/deepcode-cli/pull/208/files#diff-d2bc4bbf14eadc292d84e0ef5f7a93115c23557f533809fc80b896934291529d
View file https://github.com/lessweb/deepcode-cli/blob/b3ea1d5a8592c56e63e909d3f9cebcb4253b217a/.husky/pre-commit
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/lessweb/deepcode-cli/pull/208/{{ revealButtonHref }}
CHANGELOG.mdhttps://github.com/lessweb/deepcode-cli/pull/208/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
View file https://github.com/lessweb/deepcode-cli/blob/b3ea1d5a8592c56e63e909d3f9cebcb4253b217a/CHANGELOG.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/lessweb/deepcode-cli/pull/208/{{ revealButtonHref }}
package.jsonhttps://github.com/lessweb/deepcode-cli/pull/208/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519
View file https://github.com/lessweb/deepcode-cli/blob/b3ea1d5a8592c56e63e909d3f9cebcb4253b217a/package.json
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/lessweb/deepcode-cli/pull/208/{{ revealButtonHref }}
https://github.com/lessweb/deepcode-cli/pull/208/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519
https://github.com/lessweb/deepcode-cli/pull/208/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/208/files
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/208/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.