diff --git a/.github/workflows/registry.yml b/.github/workflows/registry.yml new file mode 100644 index 0000000..1894f91 --- /dev/null +++ b/.github/workflows/registry.yml @@ -0,0 +1,33 @@ +name: Generate Registry +on: + push: + branches: [main] + paths: + - "**/meta.json" + pull_request: + branches: [main] + paths: + - "**/meta.json" + +jobs: + generate: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Validate & generate registry.json + run: node scripts/registry.js + + - name: Commit registry.json + if: github.event_name == 'push' + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add registry.json + git diff --cached --quiet || git commit -m "chore: regenerate registry.json" + git push