Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

successComment deprecation warning is logged for releases with no commits, even when successComment is not set

未关闭 适合新手
#1,297 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
javascript
领域
release

调研方向

从 lib/success.js 中的 success() 入口点开始,检查将 successComment === false 与空的 commits 列表结合起来的分支。使用 commits: [] 且不提供 successComment 选项来复现该行为,然后添加一个回归测试,表明只有显式设置为 false 的 successComment 才会记录弃用警告,而空的 commits 仍会记录其正常消息。

由索引模型根据 Issue 内容生成。

描述

On 12.0.9 (same code on master), lib/success.js logs the "'false' for 'successComment' is deprecated" warning for any release with an empty commits list, even when successComment was never set.

if (successComment === false || isEmpty(commits)) {
  if (isEmpty(commits)) {
    logger.log("No commits found in release");
  }
  logger.log("Skip commenting on issues and pull requests.");
  logger.warn(
    `DEPRECATION: 'false' for 'successComment' is deprecated and will be removed in a future major version. Use 'successCommentCondition' instead.`,
  );
}

Both halves of the condition end up in the same branch, so the logger.warn runs for the empty-commits case too. We hit it through a monorepo release tool that creates releases for packages whose path-filtered commit list is empty (dependency-only releases). Nothing in our config sets successComment or successCommentCondition, and the warning shows up once per such release.

Following the advice in the message doesn't help either: the first branch is taken before successCommentCondition is read, so setting it to false or a condition changes nothing about the warning.

To reproduce, call success() with commits: [] and no successComment option. You get the "No commits found in release" log line followed by the deprecation warning.

I think the warning should only be logged when successComment === false. Happy to send a PR for that with a test if that's welcome.

主要语言
JavaScript
星标
535
派生
150
平均合并
1 分钟
30 天内合并 PR
3

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

semantic-release/github 的其他 Issue

查看 semantic-release/github 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。