1
0
Fork 0

Regen readme testing branch (#2197)

This commit is contained in:
Bram 2024-04-01 18:14:22 +02:00 committed by GitHub
parent deb20e3017
commit 29786f8796

View file

@ -4,6 +4,7 @@ import os
import shlex import shlex
import asyncio import asyncio
import tempfile import tempfile
import requests
from make_readme import generate_READMEs from make_readme import generate_READMEs
from pathlib import Path from pathlib import Path
@ -49,6 +50,19 @@ async def regen_readme(repository, branch):
print(f"{repository} -> branch '{branch}'") print(f"{repository} -> branch '{branch}'")
print("=" * len(f"{repository} -> branch '{branch}'")) print("=" * len(f"{repository} -> branch '{branch}'"))
branches = requests.get(
f"https://api.github.com/repos/{repository}/branches",
headers={
"Authorization": f"Bearer {token}",
"X-GitHub-Api-Version": "2022-11-28",
"Accept": "application/vnd.github+json",
}
).json()
branches = {x["name"] for x in branches}
if "testing" in branches:
branch = "testing"
with tempfile.TemporaryDirectory() as folder: with tempfile.TemporaryDirectory() as folder:
await git( await git(
[ [
@ -93,20 +107,13 @@ async def regen_readme(repository, branch):
print(f"Updated https://github.com/{repository}") print(f"Updated https://github.com/{repository}")
if __name__ == "__main__": if __name__ == '__main__':
skip = True
apps = json.load(open("../../builds/default/v3/apps.json"))["apps"] apps = json.load(open("../../builds/default/v3/apps.json"))["apps"]
for app, infos in apps.items(): for app, infos in apps.items():
if "github.com" not in infos["git"]["url"]: if "github.com" not in infos["git"]["url"]:
continue continue
if app == "dendrite":
skip = False
if skip:
continue
time.sleep(2) time.sleep(2)
asyncio.run( asyncio.run(
regen_readme( regen_readme(