diff --git a/deploy/iso/minikube-iso/Dockerfile b/deploy/iso/minikube-iso/Dockerfile index cb42088f681e..ff9ed13712fb 100644 --- a/deploy/iso/minikube-iso/Dockerfile +++ b/deploy/iso/minikube-iso/Dockerfile @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +# test for 22020 +# test for fork != minikube: we fixed the bug + FROM ubuntu:20.04 RUN apt-get update \ diff --git a/hack/jenkins/build_iso.sh b/hack/jenkins/build_iso.sh index e94d4acc35be..7962adfd00a7 100755 --- a/hack/jenkins/build_iso.sh +++ b/hack/jenkins/build_iso.sh @@ -88,7 +88,12 @@ git config user.email "minikube-bot@google.com" if [ "$release" = false ]; then # Update the user's PR with newly build ISO - git remote add ${ghprbPullAuthorLogin} git@github.com:${ghprbPullAuthorLogin}/minikube.git + # Dynamically determine the fork repository name from the PR URL or git remote + FORK_REPO_NAME=$(gh pr view ${ghprbPullId} --json headRepository --jq '.headRepository.name' 2>/dev/null || echo "minikube") + + # Try SSH first, fallback to HTTPS if SSH fails + git remote add ${ghprbPullAuthorLogin} git@github.com:${ghprbPullAuthorLogin}/${FORK_REPO_NAME}.git || \ + git remote add ${ghprbPullAuthorLogin} https://github.com/${ghprbPullAuthorLogin}/${FORK_REPO_NAME}.git git fetch ${ghprbPullAuthorLogin} git checkout -b ${ghprbPullAuthorLogin}-${ghprbSourceBranch} ${ghprbPullAuthorLogin}/${ghprbSourceBranch} diff --git a/hack/jenkins/kicbase_auto_build.sh b/hack/jenkins/kicbase_auto_build.sh index bced53a3d20b..caded9f66808 100755 --- a/hack/jenkins/kicbase_auto_build.sh +++ b/hack/jenkins/kicbase_auto_build.sh @@ -106,7 +106,12 @@ git config user.email "minikube-bot@google.com" if [ "$release" = false ]; then # Update the user's PR with the newly built kicbase image. - git remote add ${ghprbPullAuthorLogin} git@github.com:${ghprbPullAuthorLogin}/minikube.git + # Dynamically determine the fork repository name from the PR URL or git remote + FORK_REPO_NAME=$(gh pr view ${ghprbPullId} --json headRepository --jq '.headRepository.name' 2>/dev/null || echo "minikube") + + # Try SSH first, fallback to HTTPS if SSH fails + git remote add ${ghprbPullAuthorLogin} git@github.com:${ghprbPullAuthorLogin}/${FORK_REPO_NAME}.git || \ + git remote add ${ghprbPullAuthorLogin} https://github.com/${ghprbPullAuthorLogin}/${FORK_REPO_NAME}.git git fetch ${ghprbPullAuthorLogin} git checkout -b ${ghprbPullAuthorLogin}-${ghprbSourceBranch} ${ghprbPullAuthorLogin}/${ghprbSourceBranch}