Skip to content
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

chore: Update scripts/update-homebrew-formula.sh in soracom-cli #100

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/update-homebrew-formula.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function cleanup {
trap cleanup EXIT

cd "$tmpdir"
git clone git@github.com:soracom/homebrew-soracom-cli
Copy link
Collaborator

Choose a reason for hiding this comment

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

あー、このリポジトリは public リポジトリだから https でクローンしても push できてしまうんですね。
悪意を持った第三者でも push できてしまうということなので、それは防がないとダメな気がします。
むしろ git プロトコルの利用を強制して身元確認をした上で、このリポジトリの master ブランチへの push は soracom organization に所属している人だけに絞る(そもそも master ブランチへの直接の push をさせずに PR の作成を強制する)などの対策が必要そうです。

git clone https://github.com/soracom/homebrew-soracom-cli.git
cd homebrew-soracom-cli
git checkout master
bash ./update-formula.sh "$version"
Expand Down
3 changes: 2 additions & 1 deletion soracom/generated/cmd/self_update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"os"
"runtime"
"strings"
"testing"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -202,5 +203,5 @@ func TestDetermineActualPathOf(t *testing.T) {

actualPath, err = determineActualPathOf(tempSymlinkPath)
assert.NoError(t, err)
assert.Equal(t, tempFilePath, actualPath)
assert.True(t, strings.Contains(actualPath, tempFilePath)) // https://github.com/soracom/soracom-cli/pull/99#pullrequestreview-2312477684
}
Loading