File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 17
17
# List all organization extensions
18
18
import os
19
19
import pathlib
20
+ import re
20
21
import recommonmark
21
22
import requests
22
23
from datetime import datetime
25
26
HERE = pathlib .Path (__file__ ).parent
26
27
GET_REPOS = "https://api.github.com/orgs/jupyterlab-contrib/repos"
27
28
GET_REPO = "https://api.github.com/repos/jupyterlab-contrib/"
29
+ REPO_BADGE = "[]({html_url})"
28
30
TOKEN = os .getenv ("GITHUB_TOKEN" )
29
31
30
32
footer = (HERE / "extensions.tpl" ).read_text ()
51
53
if isinstance (repo , str ):
52
54
raise ValueError (data ["message" ])
53
55
54
- if "github" in repo ["name" ]:
55
- continue # Skip special repositories
56
+ if "github" in repo ["name" ] or repo [ "archived" ] :
57
+ continue # Skip special repositories and archived ones
56
58
57
59
try :
58
60
response = requests .get (
69
71
},
70
72
)
71
73
filename = repo ["name" ]
72
- (HERE / (filename + ".md" )).write_text (readme .text )
74
+ badge = REPO_BADGE .format (name = repo ["name" ], html_url = repo ["html_url" ])
75
+ readme_content = re .sub (r"\n\n" , f"\n \n { badge } " , readme .text , count = 1 )
76
+ (HERE / (filename + ".md" )).write_text (readme_content )
73
77
extensions += f"\n * [{ filename .replace ('_' , ' ' )} ]({ filename } .md): { description } "
74
78
except BaseException as err :
75
79
print (err )
You can’t perform that action at this time.
0 commit comments