offload-project/change-champion
最新稳定版本:v1.9.5
Composer 安装命令:
composer require offload-project/change-champion
包简介
A tool to manage versioning and changelogs for Composer packages, inspired by changesets
README 文档
README
A tool to manage versioning and changelogs for Composer packages, inspired by changesets.
Installation
composer require offload-project/change-champion --dev
Or install globally:
composer global require offload-project/change-champion
Quick Start
# Initialize in your project champ init # Create a changeset when you make changes champ add # View pending changesets champ status # Apply version bump and generate changelog champ version # Create a git tag champ publish
Commands
champ init
Initialize change-champion in your project. Creates a .changes directory with configuration.
champ init
# With GitHub Actions automation
champ init --with-github-actions
Options:
--with-github-actions- Also install GitHub Actions workflows for automation
champ add
Create a new changeset. Run this after making changes that should be released.
# Interactive mode champ add # Non-interactive mode champ add --type=minor --message="Add user authentication feature" # Create empty changeset (useful for CI) champ add --empty
Options:
--type,-t- Bump type:major,minor, orpatch--message,-m- Summary of the change--empty- Create an empty changeset
champ generate
Generate changesets from conventional commits (hybrid mode like release-please).
# Generate from latest tag to HEAD champ generate # Preview without creating files champ generate --dry-run # Specify commit range champ generate --from=v1.0.0 --to=HEAD
Options:
--from- Starting ref (tag, commit, or branch). Defaults to latest tag.--to- Ending ref. Defaults to HEAD.--dry-run- Show what would be generated without creating files
Conventional commit types:
| Commit Type | Changeset Type | Example |
|---|---|---|
feat |
minor | feat: add user authentication |
feat! |
major | feat!: remove deprecated API |
fix |
patch | fix: resolve null pointer |
perf |
patch | perf: optimize database queries |
refactor |
patch | refactor: extract helper function |
docs |
ignored | docs: update README |
chore |
ignored | chore: update dependencies |
test |
ignored | test: add unit tests |
ci |
ignored | ci: update workflow |
Breaking changes are detected via ! suffix (e.g., feat!:) or BREAKING CHANGE: in the commit body.
champ status
Show pending changesets and the calculated next version.
champ status
# Verbose output
champ status -v
champ version
Apply all pending changesets: update CHANGELOG.md and delete the changeset files.
# Interactive confirmation champ version # Preview changes without applying champ version --dry-run # Skip changelog generation champ version --no-changelog # Create a pre-release version champ version --prerelease alpha champ version --prerelease beta champ version --prerelease rc
Options:
--dry-run- Show what would be done without making changes--no-changelog- Skip changelog generation--prerelease,-p- Create a pre-release version (alpha, beta, rc)
Pre-release workflow:
# Create first alpha (1.0.0 → 1.1.0-alpha.1) champ version --prerelease alpha # Bump alpha (1.1.0-alpha.1 → 1.1.0-alpha.2) champ version --prerelease alpha # Move to beta (1.1.0-alpha.2 → 1.1.0-beta.1) champ version --prerelease beta # Move to RC (1.1.0-beta.1 → 1.1.0-rc.1) champ version --prerelease rc # Graduate to stable (1.1.0-rc.1 → 1.1.0) champ version
champ preview
Preview the CHANGELOG entry that would be generated without making any changes.
# Preview changelog entry champ preview # Preview with pre-release version champ preview --prerelease alpha
Options:
--prerelease,-p- Preview as a pre-release version (alpha, beta, rc)
champ check
Validate changeset files for correct format. Useful in CI to catch errors early.
champ check
Returns exit code 0 if all changesets are valid, 1 if any are invalid.
champ publish
Create a git tag for the current version.
# Create and push tag champ publish # Create tag without pushing champ publish --no-push # Preview without creating tag champ publish --dry-run
Options:
--dry-run- Show what would be done without making changes--no-push- Create tag but don't push to remote
Changeset Format
Changesets are stored in .changes/ as markdown files:
--- type: minor --- Add user authentication with OAuth2 support.
Configuration
Configuration is stored in .changes/config.json:
{
"baseBranch": "main",
"changelog": true,
"repository": "https://github.com/owner/repo",
"sections": {
"major": "Breaking Changes",
"minor": "Features",
"patch": "Fixes"
},
"releaseBranchPrefix": "release/",
"versionPrefix": "v",
"draftRelease": false
}
Options:
baseBranch- The base branch for comparisons (default:main)changelog- Whether to generate changelog entries (default:true)repository- Repository URL for linking issues (auto-detected from git remote if not set)sections- Custom section headers for changelog (defaults shown above)releaseBranchPrefix- Branch prefix for release PRs created by GitHub Actions (default:release/)versionPrefix- Prefix for version numbers in changelog headers (default:vforv1.0.0format)draftRelease- Create GitHub releases as drafts for manual publishing (default:false)
Issue Linking
Issue references in changesets are automatically linked to the repository:
--- type: patch --- Fix authentication bug. Fixes #123
Generates:
- Fix authentication bug. Fixes [#123](https://github.com/owner/repo/issues/123)
Supported patterns: #123, Fixes #123, Closes #123, Resolves #123
Semantic Versioning
Change-composer follows semver:
- patch (0.0.x) - Bug fixes, minor changes
- minor (0.x.0) - New features, backwards compatible
- major (x.0.0) - Breaking changes
When multiple changesets exist, the highest bump type wins. For example, if you have one minor and one patch
changeset, the version will be bumped as minor.
Workflow
- Make changes to your code
- Run
champ addto create a changeset describing your changes - Commit the changeset file along with your code changes
- When ready to release, run
champ versionto bump versions and update changelog - Commit the version bump
- Run
champ publishto create a git tag - Push the tag to trigger your release pipeline
GitHub Actions
The quickest way to automate releases is with champ init:
champ init --with-github-actions
This installs a workflow (.github/workflows/change-champion.yml) that uses the change-champion GitHub Action to
handle:
- check — Comments on PRs that don't include a changeset
- release — Creates a release PR when changesets are merged to
main - publish — Creates a git tag and GitHub Release when a release PR is merged
Setup
After installing the workflow, enable the required permissions:
- Go to Settings → Actions → General
- Under Workflow permissions, enable:
- "Read and write permissions"
- "Allow GitHub Actions to create and approve pull requests"
Action
The action handles checkout, event detection, and all release automation in a single step:
- uses: offload-project/change-champion@v1.8.0 with: token: ${{ secrets.GITHUB_TOKEN }}
| Input | Description | Default |
|---|---|---|
token |
GitHub token for creating PRs and releases | ${{ github.token }} |
php-version |
PHP version to use | 8.2 |
version |
Version of change-champion to use | latest |
check |
Whether to check for changesets on PRs and comment if missing | true |
create-tag |
Whether to create and push a git tag on release PR merge | true |
create-release |
Whether to create a GitHub Release on release PR merge | true |
| Output | Description |
|---|---|
published |
Whether a release was published |
version |
The released or next version |
hasChangesets |
Whether there are pending changesets |
pullRequestNumber |
The pull request number if one was created |
License
The MIT License (MIT). Please see License File for more information.
offload-project/change-champion 适用场景与选型建议
offload-project/change-champion 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.53k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「composer」 「semver」 「versioning」 「changelog」 「changesets」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 offload-project/change-champion 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 offload-project/change-champion 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 offload-project/change-champion 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Semantic Versioning Parser and Comparator
Versioning behaviour for eloquent models
Converts SemVer version (like Composer packages) into integer version with operators. Helps managing versions: store, compare, sort and retrive by conditions.
A decent, standards-compliant, Semantic Versioning (SemVer) parser and library
A Laravel package for managing model drafts.
This composer plugin enables installation of GravityForms WordPress plugin and its addons.
统计信息
- 总下载量: 2.53k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 28
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-04