feat: bm sync のバージョン固定用に pin-version input を追加する - #22
Merged
Conversation
Add a `pin-version` input that passes `--pin-version` to `bm sync`. It pins the target environment to the version the source environment points to at sync time, instead of leaving the target on "always latest" where a new version in the source environment is reflected immediately. Like `from`, it is rejected when `environment-id` is not set, since syncing to the development environment has no version pinning. Requires @basemachina/cli 1.4.0 or later; older CLIs reject the unknown option. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
mock sync output |
|
mock sync output |
|
mock sync output |
|
mock sync output |
m-shaka
approved these changes
Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
bm syncに追加する--pin-versionを Action からも指定できるようにするpin-versioninput を追加する。背景
同期先のバージョン設定が「常に最新バージョンを使う」のままだと、同期元で新しいバージョンが作られた時点で同期先にも即座に反映される。
main→stg→prdのブランチ運用で段階的にリリースしたい利用者にとっては、mainへのマージが本番への反映になってしまう。これを止めるのがbm sync --pin-version。この Action は
bm syncのオプションを 1:1 でミラーしている(from/dry/with-disable)。pin-versionだけ欠けると、この機能を使いたい利用者は Action をやめて素のbm syncを workflow に書き直すことになるため、あわせて追加する。要望元も CI 経由での利用が中心。変更内容
既存の
with-disable(真偽値 input)とfrom(environment-idとの相関チェック)の実装をそのまま踏襲している。action.yml:pin-versioninput(required: false/default: 'false')とINPUT_PIN_VERSIONの伝播scripts/run.sh:true/falseのバリデーション、environment-id未指定時のエラー、--pin-versionの付与tests/run.bats: invalid 値 /environment-id未指定 / 付与される / 付与されない の4ケースREADME.md: 入力一覧に1行追加environment-id未指定時にエラーにしているのは、開発環境への反映にはバージョン固定の概念がないため(CLI 側も同じ理由で同じエラーにしている)。CLI バージョンへの依存
この Action は
npx --no-install @basemachina/cliを実行するため、CLI のバージョンは呼び出し側のpackage.jsonに固定されたものになる。pin-version: "true"を指定しても CLI が古ければ使えない。cmd-ts は未知のフラグを parse error にするので、失敗は silent no-op ではなく明示的なエラーになる。
Ticket
https://app.notion.com/p/3bcdd1b1613c8078b49ed546552d6570