fixup! fixup! roomservice: Migrate from GitHub API to git ls-remote

Change-Id: Ide422d1b056816114c7e372bcd296dbf8675ec95
This commit is contained in:
LuK1337
2025-01-07 01:46:40 +01:00
parent d5aa270f99
commit 991fd49cd8

View File

@@ -16,10 +16,8 @@
from __future__ import print_function
import base64
import glob
import json
import netrc
import os
import re
import subprocess
@@ -51,17 +49,6 @@ if not depsonly:
repositories = []
try:
authtuple = netrc.netrc().authenticators("api.github.com")
if authtuple:
auth_string = ('%s:%s' % (authtuple[0], authtuple[2])).encode()
githubauth = base64.encodestring(auth_string).decode().replace('\n', '')
else:
githubauth = None
except:
githubauth = None
if not depsonly:
githubreq = urllib.request.Request("https://raw.githubusercontent.com/LineageOS/mirror/main/default.xml")
try:
@@ -262,7 +249,7 @@ def get_default_or_fallback_revision(repo_name):
try:
stdout = subprocess.run(
["git", "ls-remote", "-b", "https://:@github.com/LineageOS/" + repo_name],
["git", "ls-remote", "-h", "https://:@github.com/LineageOS/" + repo_name],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
).stdout.decode()