From a3a1a11502c0ef1decb624fb8b2cacc1291e5b83 Mon Sep 17 00:00:00 2001 From: Max Litruv Boonzaayer Date: Fri, 17 Apr 2026 02:11:08 +1000 Subject: [PATCH] Add auto-update for index.json via Gitea Actions --- .gitea/workflows/update-index.yml | 48 +++++++++++++++++++++++++++++++ plugins/example-plugin-2.json | 12 ++++++++ 2 files changed, 60 insertions(+) create mode 100644 .gitea/workflows/update-index.yml diff --git a/.gitea/workflows/update-index.yml b/.gitea/workflows/update-index.yml new file mode 100644 index 0000000..6b5fad4 --- /dev/null +++ b/.gitea/workflows/update-index.yml @@ -0,0 +1,48 @@ +name: Update Plugin Index +on: + push: + branches: [ main ] + paths: + - 'plugins/*.json' + +jobs: + update-index: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Generate index.json + run: | + cd plugins + echo '{' > index.json + echo ' "version": "1.0.0",' >> index.json + echo ' "updatedAt": "'$(date -u +"%Y-%m-%dT%H:%M:%S.000Z")'",' >> index.json + echo ' "plugins": [' >> index.json + + first=true + for file in *.json; do + if [ "$file" != "index.json" ]; then + plugin_id="${file%.json}" + if [ "$first" = true ]; then + echo " \"$plugin_id\"" >> index.json + first=false + else + echo " ,\"$plugin_id\"" >> index.json + fi + fi + done + + echo ' ]' >> index.json + echo '}' >> index.json + + - name: Commit index.json + run: | + git config user.name "Gitea Actions" + git config user.email "actions@gitea.local" + git add plugins/index.json + if git diff --staged --quiet; then + echo "No changes to commit" + else + git commit -m "Auto-update plugin index" + git push + fi diff --git a/plugins/example-plugin-2.json b/plugins/example-plugin-2.json index e69de29..e535c49 100644 --- a/plugins/example-plugin-2.json +++ b/plugins/example-plugin-2.json @@ -0,0 +1,12 @@ +{ + "id": "example-plugin-2", + "name": "Example Plugin 2", + "version": "1.0.0", + "description": "A second example plugin demonstrating additional capabilities", + "author": "litruv", + "repository": "http://synbox.ruv.wtf:8418/litruv/Plugin-Example2.git", + "downloadUrl": "http://synbox.ruv.wtf:8418/litruv/Plugin-Example2/archive/main.zip", + "homepage": "http://synbox.ruv.wtf:8418/litruv/Plugin-Example2", + "tags": ["example", "demo", "filtering", "validation"], + "addedDate": "2026-04-17T00:00:00.000Z" +}