File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed
Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15+ # test for 22020
16+
1517FROM ubuntu:20.04
1618
1719RUN apt-get update \
Original file line number Diff line number Diff line change @@ -88,7 +88,12 @@ git config user.email "minikube-bot@google.com"
8888if [ " $release " = false ]; then
8989 # Update the user's PR with newly build ISO
9090
91- git remote add ${ghprbPullAuthorLogin} git@github.com:${ghprbPullAuthorLogin} /minikube.git
91+ # Dynamically determine the fork repository name from the PR URL or git remote
92+ FORK_REPO_NAME=$( gh pr view ${ghprbPullId} --json headRepository --jq ' .headRepository.name' 2> /dev/null || echo " minikube" )
93+
94+ # Try SSH first, fallback to HTTPS if SSH fails
95+ git remote add ${ghprbPullAuthorLogin} git@github.com:${ghprbPullAuthorLogin} /${FORK_REPO_NAME} .git || \
96+ git remote add ${ghprbPullAuthorLogin} https://github.com/${ghprbPullAuthorLogin} /${FORK_REPO_NAME} .git
9297 git fetch ${ghprbPullAuthorLogin}
9398 git checkout -b ${ghprbPullAuthorLogin} -${ghprbSourceBranch} ${ghprbPullAuthorLogin} /${ghprbSourceBranch}
9499
Original file line number Diff line number Diff line change @@ -106,7 +106,12 @@ git config user.email "minikube-bot@google.com"
106106if [ " $release " = false ]; then
107107 # Update the user's PR with the newly built kicbase image.
108108
109- git remote add ${ghprbPullAuthorLogin} git@github.com:${ghprbPullAuthorLogin} /minikube.git
109+ # Dynamically determine the fork repository name from the PR URL or git remote
110+ FORK_REPO_NAME=$( gh pr view ${ghprbPullId} --json headRepository --jq ' .headRepository.name' 2> /dev/null || echo " minikube" )
111+
112+ # Try SSH first, fallback to HTTPS if SSH fails
113+ git remote add ${ghprbPullAuthorLogin} git@github.com:${ghprbPullAuthorLogin} /${FORK_REPO_NAME} .git || \
114+ git remote add ${ghprbPullAuthorLogin} https://github.com/${ghprbPullAuthorLogin} /${FORK_REPO_NAME} .git
110115 git fetch ${ghprbPullAuthorLogin}
111116 git checkout -b ${ghprbPullAuthorLogin} -${ghprbSourceBranch} ${ghprbPullAuthorLogin} /${ghprbSourceBranch}
112117
You can’t perform that action at this time.
0 commit comments