Update .gitea/workflows/update-factorio-modlist.yml
This commit is contained in:
@@ -8,10 +8,8 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Setup Git
|
- name: Install jq
|
||||||
run: |
|
run: sudo apt-get update && sudo apt-get install -y jq
|
||||||
git config --global user.name "Gitea Action"
|
|
||||||
git config --global user.email "action@gitea.local"
|
|
||||||
|
|
||||||
- name: Get list of .zip files via API
|
- name: Get list of .zip files via API
|
||||||
env:
|
env:
|
||||||
@@ -34,15 +32,16 @@ jobs:
|
|||||||
# Scrive mods.json
|
# Scrive mods.json
|
||||||
echo "$json_array" > mods.json
|
echo "$json_array" > mods.json
|
||||||
|
|
||||||
- name: Commit and push mods.json
|
- name: Upload mods.json via API
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.gamerarena }}
|
||||||
|
GITEA_API_URL: https://git.garpnet.it/api/v1
|
||||||
|
OWNER: GamerArena
|
||||||
|
REPO: FastDL
|
||||||
|
BRANCH: main
|
||||||
run: |
|
run: |
|
||||||
# Clona repo temporaneamente
|
content=$(base64 -w 0 mods.json)
|
||||||
git clone https://git.garpnet.it/GamerArena/FastDL.git
|
curl -X PUT -H "Authorization: token $GITEA_TOKEN" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{\"content\":\"$content\",\"branch\":\"$BRANCH\",\"message\":\"Update mods.json\"}" \
|
||||||
# Commit e push
|
"$GITEA_API_URL/repos/$OWNER/$REPO/contents/mods.json"
|
||||||
git add mods.json
|
|
||||||
git commit -m "Update mods.json with .zip files"
|
|
||||||
git push origin main
|
|
||||||
Reference in New Issue
Block a user