This commit is contained in:
parent
8ce95e38a8
commit
383028fcca
2 changed files with 15 additions and 2 deletions
|
@ -29,7 +29,6 @@ for mod in glob.glob("pack/mods/*.toml"):
|
||||||
moddata["site"] = "Modrinth"
|
moddata["site"] = "Modrinth"
|
||||||
|
|
||||||
data = requests.get("https://api.modrinth.com/v2/project/" + id).json()
|
data = requests.get("https://api.modrinth.com/v2/project/" + id).json()
|
||||||
print("Processed: " + moddata["name"])
|
|
||||||
elif "curseforge" in data["update"]:
|
elif "curseforge" in data["update"]:
|
||||||
moddata["url"] = "https://legacy.curseforge.com/projects/" + str(data["update"]["curseforge"]["project-id"])
|
moddata["url"] = "https://legacy.curseforge.com/projects/" + str(data["update"]["curseforge"]["project-id"])
|
||||||
moddata["site"] = "CurseForge"
|
moddata["site"] = "CurseForge"
|
||||||
|
@ -93,7 +92,7 @@ with open("wiki/Licenses.md", "w") as f:
|
||||||
data = mods[mod]
|
data = mods[mod]
|
||||||
f.write("## " + mod + "\r\n")
|
f.write("## " + mod + "\r\n")
|
||||||
f.write("<b>")
|
f.write("<b>")
|
||||||
if data["license"] != None:
|
if "license" in data:
|
||||||
if data["license"]["url"] != None:
|
if data["license"]["url"] != None:
|
||||||
f.write("<a href=\"" + data["license"]["url"] + "\">" + data["license"] + "")
|
f.write("<a href=\"" + data["license"]["url"] + "\">" + data["license"] + "")
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -17,9 +17,23 @@ jobs:
|
||||||
path: "wiki"
|
path: "wiki"
|
||||||
ref: "main"
|
ref: "main"
|
||||||
|
|
||||||
|
- name: Restore cached licenses
|
||||||
|
id: cache-licenses-restore
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
path: licenses.json
|
||||||
|
key: ${{ runner.os }}-licenses
|
||||||
|
|
||||||
- name: "Update modlist"
|
- name: "Update modlist"
|
||||||
run: python pack/.forgejo/scripts/update-wiki.py
|
run: python pack/.forgejo/scripts/update-wiki.py
|
||||||
|
|
||||||
|
- name: Save cached licenses
|
||||||
|
id: cache-licenses-restore
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
with:
|
||||||
|
path: licenses.json
|
||||||
|
key: ${{ steps.cache-licenses-restore.outputs.cache-primary-key }}
|
||||||
|
|
||||||
- name: "Commit changes"
|
- name: "Commit changes"
|
||||||
run: |
|
run: |
|
||||||
cd wiki
|
cd wiki
|
||||||
|
|
Loading…
Reference in a new issue