-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GitHub (Enterprise) fixes #18
Conversation
Hi @cyb3rko: did you actually get this running? The URLs to users profiles seem fixed with your changes, but I still cannot download users' avatars. Tried manually downloading it with curl (even with a bearer token) - nope. Seems this is a known problem for GitHub Enterprise: octokit/octokit.js#2061 (comment). |
I got this running by scripting Selenium. Details
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.keys import Keys
import time
import os
start_url = "https://idp.company.com/idp/startSSO.ping?PartnerSpId=https://github.company.com"
username = "none"
password = os.getenv("GH_TOKEN")
avatar_url = "https://avatars.github.company.com/u/9214?&size=32"
download_path = "avatar.jpg"
chrome_options = Options()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-gpu")
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--disable-dev-shm-usage")
chrome_options.add_argument("--disable-extensions")
chrome_options.add_argument("--disable-infobars")
chrome_options.add_argument("--disable-notifications")
chrome_options.add_argument("--window-size=1920,1080")
driver = webdriver.Chrome(options=chrome_options)
try:
driver.get(start_url)
time.sleep(3)
location_dropdown = Select(driver.find_element(By.ID, "location"))
location_dropdown.select_by_value("HO")
time.sleep(1)
sign_on_button = driver.find_element(By.CSS_SELECTOR, "a.ping-button.normal.allow[title='Sign On']")
sign_on_button.click()
time.sleep(5)
driver.get(avatar_url)
time.sleep(3)
avatar_element = driver.find_element(By.TAG_NAME, "img")
with open(download_path, "wb") as file:
file.write(avatar_element.screenshot_as_png)
print(f"Avatar downloaded successfully to {download_path}.")
finally:
driver.quit() |
Also, this seems to run when rendering from CI and pushing to gh-pages. They only locally don't work. |
Hello @mihaigalos, I remember having issues with the avatars, but I'm currently not sure if I fixed it or not. |
Fyi this repo had been forked, the fork has support for avatars and is actively maintained https://github.com/ojacques/mkdocs-git-committers-plugin-2 |
Nice, good to know. Then I can close this here as it seems to be implemented in https://github.com/ojacques/mkdocs-git-committers-plugin-2 |
Fixes #16
And fixes one part of #17 (wrong URLs when clicking the author names)