Regen readme testing branch (#2197)
This commit is contained in:
parent
deb20e3017
commit
29786f8796
1 changed files with 16 additions and 9 deletions
|
@ -4,6 +4,7 @@ import os
|
|||
import shlex
|
||||
import asyncio
|
||||
import tempfile
|
||||
import requests
|
||||
|
||||
from make_readme import generate_READMEs
|
||||
from pathlib import Path
|
||||
|
@ -49,6 +50,19 @@ async def regen_readme(repository, branch):
|
|||
print(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:
|
||||
await git(
|
||||
[
|
||||
|
@ -93,24 +107,17 @@ async def regen_readme(repository, branch):
|
|||
print(f"Updated https://github.com/{repository}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
skip = True
|
||||
if __name__ == '__main__':
|
||||
apps = json.load(open("../../builds/default/v3/apps.json"))["apps"]
|
||||
|
||||
for app, infos in apps.items():
|
||||
if "github.com" not in infos["git"]["url"]:
|
||||
continue
|
||||
|
||||
if app == "dendrite":
|
||||
skip = False
|
||||
|
||||
if skip:
|
||||
continue
|
||||
|
||||
time.sleep(2)
|
||||
asyncio.run(
|
||||
regen_readme(
|
||||
infos["git"]["url"].replace("https://github.com/", ""),
|
||||
infos["git"]["branch"],
|
||||
)
|
||||
)
|
||||
)
|
Loading…
Reference in a new issue