Workaround bug in gh cli (#3338)
Add workaround for https://github.com/cli/cli/issues/1820 to our
integration scripting. There's something broken about detection for the
appropriate HEAD ref for the PR, so we set it explicitly.
diff --git a/scripts/git/main_to_google.sh b/scripts/git/main_to_google.sh
index ee07573..b9e56ae 100755
--- a/scripts/git/main_to_google.sh
+++ b/scripts/git/main_to_google.sh
@@ -56,4 +56,7 @@
echo "${BODY?}"
exit 1
fi
-gh pr create --base google --title="${TITLE?}" --body="${BODY?}"
+
+# Workaround https://github.com/cli/cli/issues/1820
+GITHUB_USERNAME="$(gh config get -h github.com user)"
+gh pr create --base google --head="${GITHUB_USERNAME?}:${PR_BRANCH?}" --title="${TITLE?}" --body="${BODY?}"