Skip to content

feat: bm sync のバージョン固定用に pin-version input を追加する - #22

Merged
yebis0942 merged 1 commit into
mainfrom
feat/pin-version
Aug 18, 2026
Merged

feat: bm sync のバージョン固定用に pin-version input を追加する#22
yebis0942 merged 1 commit into
mainfrom
feat/pin-version

Conversation

@yebis0942

@yebis0942 yebis0942 commented Aug 17, 2026

Copy link
Copy Markdown
Member

What

bm sync に追加する --pin-version を Action からも指定できるようにする pin-version input を追加する。

背景

同期先のバージョン設定が「常に最新バージョンを使う」のままだと、同期元で新しいバージョンが作られた時点で同期先にも即座に反映される。mainstgprd のブランチ運用で段階的にリリースしたい利用者にとっては、main へのマージが本番への反映になってしまう。これを止めるのが bm sync --pin-version

この Action は bm sync のオプションを 1:1 でミラーしている(from / dry / with-disable)。pin-version だけ欠けると、この機能を使いたい利用者は Action をやめて素の bm sync を workflow に書き直すことになるため、あわせて追加する。要望元も CI 経由での利用が中心。

変更内容

既存の with-disable(真偽値 input)と fromenvironment-id との相関チェック)の実装をそのまま踏襲している。

  • action.yml: pin-version input(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 ではなく明示的なエラーになる。

error: found 1 error
  sync --unknown-flag-test
       ^ Unknown arguments

Ticket

https://app.notion.com/p/3bcdd1b1613c8078b49ed546552d6570

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>
@github-actions

Copy link
Copy Markdown

mock sync output

@github-actions

Copy link
Copy Markdown

mock sync output

@github-actions

Copy link
Copy Markdown

mock sync output

@github-actions

Copy link
Copy Markdown

mock sync output

@yebis0942
yebis0942 marked this pull request as ready for review August 18, 2026 08:26
@yebis0942
yebis0942 requested a review from a team as a code owner August 18, 2026 08:26
@yebis0942
yebis0942 requested review from m-shaka and taro-28 August 18, 2026 08:26
@yebis0942
yebis0942 merged commit c8aa523 into main Aug 18, 2026
6 checks passed
@yebis0942
yebis0942 deleted the feat/pin-version branch August 18, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants