test
All checks were successful
Update wiki / test (push) Successful in 1m56s

This commit is contained in:
Ashley Graves 2024-08-01 01:21:44 +02:00
parent 8ce95e38a8
commit 383028fcca
2 changed files with 15 additions and 2 deletions

View file

@ -29,7 +29,6 @@ for mod in glob.glob("pack/mods/*.toml"):
moddata["site"] = "Modrinth"
data = requests.get("https://api.modrinth.com/v2/project/" + id).json()
print("Processed: " + moddata["name"])
elif "curseforge" in data["update"]:
moddata["url"] = "https://legacy.curseforge.com/projects/" + str(data["update"]["curseforge"]["project-id"])
moddata["site"] = "CurseForge"
@ -93,7 +92,7 @@ with open("wiki/Licenses.md", "w") as f:
data = mods[mod]
f.write("## " + mod + "\r\n")
f.write("<b>")
if data["license"] != None:
if "license" in data:
if data["license"]["url"] != None:
f.write("<a href=\"" + data["license"]["url"] + "\">" + data["license"] + "")
else:

View file

@ -17,9 +17,23 @@ jobs:
path: "wiki"
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"
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"
run: |
cd wiki