Update .gitea/workflows/update-factorio-modlist.yml

This commit is contained in:
2025-11-23 18:33:09 +00:00
parent 3bea77c20c
commit 5114dd430e

View File

@@ -18,7 +18,7 @@ jobs:
run: |
# Prende la lista di file nella root del repo
response=$(curl -s -H "Authorization: token $GITEA_TOKEN" \
"$GITEA_API_URL/repos/$OWNER/$REPO/contents?ref=$BRANCH")
"$GITEA_API_URL/repos/$OWNER/$REPO/contents/Factorio?ref=$BRANCH")
# Filtra solo i file .zip e crea array JSON
zip_files=$(echo "$response" | jq -r '.[] | select(.type=="file") | select(.name|endswith(".zip")) | .name')
@@ -38,7 +38,7 @@ jobs:
BRANCH: main
run: |
response=$(curl -s -H "Authorization: token $GITEA_TOKEN" \
"$GITEA_API_URL/repos/$OWNER/$REPO/contents/mods.json?ref=$BRANCH")
"$GITEA_API_URL/repos/$OWNER/$REPO/contents/Factorio/mods.json?ref=$BRANCH")
sha=$(echo "$response" | jq -r '.sha // empty')
if [ -n "$sha" ]; then
curl -X DELETE -H "Authorization: token $GITEA_TOKEN" \
@@ -62,4 +62,4 @@ jobs:
curl -X PUT -H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"content\":\"$content\",\"branch\":\"$BRANCH\",\"message\":\"Update mods.json\"}" \
"$GITEA_API_URL/repos/$OWNER/$REPO/contents/mods.json"
"$GITEA_API_URL/repos/$OWNER/$REPO/contents/Factorio/mods.json"