Skip to content

Commit d32a312

Browse files
committed
chore(workflows/preview_link): github.event.pull_request.base が空の時の対策
1 parent 8f1f224 commit d32a312

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/script/build.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,12 @@ elif [[ $1 == --pull ]]; then
7979
time=$(TZ=Asia/Tokyo date +'%F %T %Z')
8080

8181
# 基底ブランチに新しいコミットがある場合のため、基底リポジトリから取り寄せる
82-
git remote add base "$base_git_url"
83-
git fetch base "$base_git_ref"
82+
if [[ $base_git_url && $base_git_ref ]]; then
83+
# 手動でトリガーした時は github.event.pull_request.base が空のことがある?
84+
# なので非空の時にのみ実行
85+
git remote add base "$base_git_url"
86+
git fetch base "$base_git_ref"
87+
fi
8488

8589
echo "# PR [\#$pr]($preview_repo_url/pull/$pr) プレビュー"
8690
echo "- ⌚ 更新時刻: $time"

0 commit comments

Comments
 (0)