diff --git a/.circleci/config.yml b/.circleci/config.yml index cdbaa49ee26..d709e2b17bf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1196,6 +1196,17 @@ jobs: executor: win/default steps: - checkout + - run: + name: Make sure Python3 exists + command: | + $pythonpath=(Split-Path((Get-Command python).Path)) + If (Test-Path -Path ${pythonpath}\python3.exe) { + echo "using ${pythonpath}\python3.exe" + } + else { + cmd /c mklink ${pythonpath}\python3.exe ${pythonpath}\python.exe + } + shell: powershell.exe - run: name: Upgrade pip command: python3 -m pip install --upgrade pip diff --git a/tools/release/releases.py b/tools/release/releases.py index 7168bd3d383..d0476d6176f 100644 --- a/tools/release/releases.py +++ b/tools/release/releases.py @@ -64,7 +64,8 @@ def get_current_user(github_token, prefer_fb_email=True): response = requests.get(url, headers=headers) response.raise_for_status() ret = response.json() - if not ret["email"].endswith("@fb.com") and prefer_fb_email: + default_email = ret["email"] + if default_email is None or (not default_email.endswith("@fb.com") and prefer_fb_email): while emails_url: response = requests.get(emails_url, headers=headers) response.raise_for_status() @@ -72,7 +73,7 @@ def get_current_user(github_token, prefer_fb_email=True): ( email["email"] for email in response.json() - if email["verified"] and email["email"].endswith("@fb.com") + if email["verified"] and email["email"].endswith("@fb.com") and (email["visibility"] is None or email["visibility"].lower() == "public") ), None, ) @@ -81,6 +82,17 @@ def get_current_user(github_token, prefer_fb_email=True): break else: emails_url = response.links.get("next", {}).get("url") + if default_email is None: + default_email = next( + ( + email["email"] + for email in response.json() + if email["verified"] and (email["visibility"] is None or email["visibility"].lower() == "public") + ), + None, + ) + if ret["email"] is None and not default_email is None: + ret["email"] = default_email return ret