Skip to content

Commit 38a0f30

Browse files
committed
generate rank-only JSON for every location
1 parent 889dc27 commit 38a0f30

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

.github/workflows/weekly_update.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,16 @@ jobs:
2929
run: |
3030
import datetime, glob, os, subprocess, sys
3131
32-
MAX_IN_RUN = 4
32+
MAX_IN_RUN = 3
3333
STALE_DAYS = 5
3434
GENERATED = {
35-
"%s.md": "---\ntype: location\nlocation: %s\nmode: commits\n---\n",
36-
"%s_private.md": "---\ntype: location\nlocation: %s\nmode: all\n---\n",
37-
"%s_public.md": "---\ntype: location\nlocation: %s\nmode: contributions\n---\n",
35+
"%s.md": "---\ntype: location\nlocation: %s\nmode: commits\n---\n",
36+
"%s_private.md": "---\ntype: location\nlocation: %s\nmode: all\n---\n",
37+
"%s_public.md": "---\ntype: location\nlocation: %s\nmode: contributions\n---\n",
38+
"rank_only/%s.json": "---\nlayout: rank_only\nlocation: %s\n---\n",
3839
}
3940
41+
subprocess.run("mkdir -p rank_only", shell=True, check=True)
4042
preset_list = subprocess.run(["most-active-github-users-counter", "--list-presets"], capture_output=True, text=True).stdout
4143
regenerated = False
4244
to_process = []
@@ -57,7 +59,7 @@ jobs:
5759
f.write(content % filename)
5860
5961
# remove files for presets no longer supported (if any)
60-
for filename in sorted(glob.glob("*.md") + glob.glob("_data/locations/*.yml")):
62+
for filename in sorted(glob.glob("*.md") + glob.glob("_data/locations/*.yml") + glob.glob("rank_only/*.json")):
6163
if filename not in expected:
6264
os.remove(filename)
6365
regenerated = True
@@ -74,7 +76,7 @@ jobs:
7476
sys.exit(0)
7577
7678
if regenerated:
77-
subprocess.run('git add *.md _data/locations/*.yml && git commit -am "regenerate location pages"', shell=True, check=True)
79+
subprocess.run('git add *.md _data/locations/*.yml rank_only/*.json && git commit -am "regenerate location pages"', shell=True, check=True)
7880
7981
for key in to_process[0:MAX_IN_RUN]:
8082
preset = flookup[key]["preset"]

0 commit comments

Comments
 (0)