Files
mivodev.github.io/.github/workflows/update-registry.yml
2026-01-18 17:41:13 +07:00

44 lines
1.1 KiB
YAML

name: Update Plugin Registry
on:
schedule:
- cron: '0 0 * * *' # Run daily at midnight
workflow_dispatch: # Allow manual trigger
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write # Needed to push changes
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
- name: Generate Registry
run: php scripts/generate_registry.php
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check for Changes
id: check_changes
run: |
if [[ -n $(git status -s public/plugins.json) ]]; then
echo "has_changes=true" >> $GITHUB_OUTPUT
fi
- name: Commit and Push
if: steps.check_changes.outputs.has_changes == 'true'
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add public/plugins.json
git commit -m "chore(registry): update plugins.json"
git push