Skip to content

Modify script to work correctly under branch protection settings#132

Merged
bearmini merged 2 commits intomasterfrom
support-branch-protection
Aug 29, 2025
Merged

Modify script to work correctly under branch protection settings#132
bearmini merged 2 commits intomasterfrom
support-branch-protection

Conversation

@osawata36
Copy link
Contributor

CLIリリース用スクリプトを修正しました。homebrew-soracom-cli リポジトリに直接プッシュを禁止するブランチ保護が設定されるようになったため、トピックブランチを作成してプルリクエストを作成するようにスクリプト処理を変更しました。

@osawata36 osawata36 requested a review from bearmini as a code owner July 22, 2025 21:58

# Push feature branch and create PR (force push to overwrite existing branch)
git push --force-with-lease origin "$branch_name"
gh pr create --title "Bump version to $version" \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここまで実行して gh コマンドがインストールされてない環境だと PR の作成に失敗してしまい、手作業で PR を作り直さないといけなくなってしまうと思うので、スクリプトの最初の方で

command -v gh > /dev/null 2>&1 || {
    echo "'gh' is required."
    echo "Install gh by following the instructions: https://github.com/cli/cli#installation"
    exit 1
}

というような感じで gh コマンドが使えるかどうかをチェックしてあげるとより親切かもしれません。

(厳密にいうと git コマンドも同様ですが、git コマンドが無いと最初の clone 時点で失敗するので実害が無いので現時点ではチェックしてない感じですね)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

遅くなりましたが、gh コマンドのチェックを最初に追加しました

Copy link
Collaborator

@bearmini bearmini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thank you!!

@bearmini bearmini merged commit 4227aa3 into master Aug 29, 2025
1 check passed
@bearmini bearmini deleted the support-branch-protection branch August 29, 2025 04:41
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