-
Notifications
You must be signed in to change notification settings - Fork 0
chore(auto-release): 正式版本自动设为 latest release #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Auto-detect prerelease from tag name (-rc/-alpha/-beta) instead of relying on prerelease input. Stable versions become latest release, prerelease versions do not. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Walkthrough将 auto-release Action 改为基于 Git 标签后缀(-rc/-alpha/-beta,大小写不敏感)自动识别预发布,依据该判断动态设置 Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Workflow as Workflow Trigger
participant Action as auto-release Composite Action
participant Git as Git Tag / Ref
participant GHAPI as GitHub Releases API
Workflow->>Action: invoke with tag ref
Action->>Git: read tag name
Note right of Action: heuristic: /-(rc|alpha|beta)$/i
Action->>Action: set isPrerelease (true/false)
Action->>GHAPI: create release (prerelease=isPrerelease, make_latest = !isPrerelease)
GHAPI-->>Action: release created
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
actions/auto-release/action.yml (1)
17-20: 🛠️ Refactor suggestion | 🟠 Major
prerelease输入参数现已失效,应移除或标记为废弃。代码在 Line 186 改为从 tag 名称自动检测预发布版本,但
prerelease输入参数仍然保留在定义中。这会导致:
- 用户设置此参数时不会产生任何效果,造成困惑
- Line 49 的
INPUT_PRERELEASE环境变量也成为死代码建议移除该输入参数,或在描述中明确标注为"已废弃,将被忽略"。
♻️ 建议的修改方案
方案 1:移除废弃参数
- prerelease: - description: '是否标记为预发布' - required: false - default: 'false'同时移除 env 中的引用:
env: CHANGELOG_PATH: ${{ inputs.changelog-path }} INPUT_DRAFT: ${{ inputs.draft }} - INPUT_PRERELEASE: ${{ inputs.prerelease }}方案 2:保留但标记为废弃
prerelease: - description: '是否标记为预发布' + description: '(已废弃,将被忽略)预发布状态现从 tag 名称自动检测 (-rc/-alpha/-beta)' required: false default: 'false' + deprecationMessage: '此参数已废弃,预发布状态现从 tag 名称自动检测'
The prerelease status is now auto-detected from the tag name, making the prerelease input parameter obsolete. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
-rc/-alpha/-beta) instead of relying onprereleaseinputmake_latestdynamically: stable versions become latest, prerelease versions do not影响范围
使用
auto-releaseaction 的仓库(修改后自动生效):Test plan
验证步骤:
auto-release的仓库推送正式版本 tag(如v0.3.0)v0.3.1-rc.1),确认显示 "Pre-release" 标签🤖 Generated with Claude Code
Summary by CodeRabbit
Changed
Removed
Fixed