Skip to content

Auto update

Auto update #13

Workflow file for this run

name: Auto update
on:
push:
paths:
- "ModConfigs/**"
workflow_dispatch:
jobs:
update-index:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Generate Index
run: |
root_url="https://{root}"
mods=""
for file in $(find ModConfigs/patch -name '*.json'); do
version=$(basename $(dirname $file))
name=$(basename $(dirname $(dirname $file)))
url="{root}/${file#ModConfigs/}"
mods+="{ \"name\": \"$name\", \"version\": \"$version\", \"url\": \"$url\" },"
done
index="{ \"root\": \"$root_url\", \"mods\": [ ${mods%,} ] }"
echo $index > ModConfigs/index.json
- name: Commit and push changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update index.json
file_pattern: ModConfigs/index.json
send-update:
needs: update-index
runs-on: ubuntu-20.04
steps:
- name: Send update
run: wget -O- https://vpdl.nvoid.me/update