Skip to content
Merged
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
8 changes: 7 additions & 1 deletion push-merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,14 @@ set -o pipefail
echo "Running: git rev-parse refs/heads/repo-HEAD-saved"
saved_ref=$(git rev-parse refs/heads/repo-HEAD-saved) ||
die "Failed to read local ref refs/heads/repo-HEAD-saved"

git_url="$DEFAULT_PACKAGE_GIT_URL"
if [[ -n "$FETCH_GIT_TOKEN" ]] && [[ "$git_url" == https://github.com/* ]]; then
git_url="${git_url/https:\/\//https:\/\/${FETCH_GIT_TOKEN}@}"
fi

echo "Running: git ls-remote $DEFAULT_PACKAGE_GIT_URL refs/heads/$DEFAULT_GIT_BRANCH"
remote_ref=$(git ls-remote "$DEFAULT_PACKAGE_GIT_URL" "refs/heads/$DEFAULT_GIT_BRANCH" |
remote_ref=$(git ls-remote "$git_url" "refs/heads/$DEFAULT_GIT_BRANCH" |
awk '{print $1}') ||
die "Failed to read remote ref refs/heads/$DEFAULT_GIT_BRANCH"
set +o pipefail
Expand Down