sync-marketplace-from-sources #944
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: sync-marketplace-from-sources | |
| on: | |
| schedule: | |
| - cron: "*/10 * * * *" # every 10 min — keep rolling commit hashes fresh | |
| workflow_dispatch: {} | |
| push: | |
| branches: [main] | |
| paths: | |
| - ".claude-plugin/marketplace.json" | |
| - ".grok-plugin/marketplace.json" | |
| - "scripts/sync_marketplace.py" | |
| - "scripts/build_readme.py" | |
| - "scripts/generate-grok-catalog.py" | |
| - "scripts/generate-grok-plugin-index.py" | |
| - "scripts/check-grok-pins-fresh.py" | |
| - "scripts/run-official-grok-validate.sh" | |
| - "scripts/vendor/**" | |
| - "scripts/stranger-smoke.sh" | |
| permissions: | |
| contents: write | |
| jobs: | |
| sync: | |
| runs-on: ${{ vars.RUNNER || 'ubuntu-latest' }} | |
| steps: | |
| - uses: actions/checkout@v7.0.0 | |
| - uses: actions/setup-python@v6.3.0 | |
| with: | |
| python-version: "3.13" | |
| - name: Sync marketplace metadata from each plugin source | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| run: python scripts/sync_marketplace.py | |
| - name: Regenerate README from the catalog | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| run: python scripts/build_readme.py | |
| - name: Generate Grok catalog (shas + keywords from Claude catalog) | |
| run: python scripts/generate-grok-catalog.py | |
| - name: Generate Grok plugin index (rich components for TUI Marketplace) | |
| run: python scripts/generate-grok-plugin-index.py | |
| - name: Validate catalogs (Grok SHA pins + Claude/Grok parity) | |
| run: python scripts/validate-catalog.py | |
| - name: Verify plugin-index is current | |
| run: python scripts/generate-grok-plugin-index.py --check | |
| - name: Official Grok catalog validate (.grok-plugin only) | |
| run: bash scripts/run-official-grok-validate.sh | |
| - name: Pin freshness (sha == origin HEAD) | |
| run: python scripts/check-grok-pins-fresh.py | |
| - name: Commit if changed | |
| run: | | |
| if ! git diff --quiet -- .claude-plugin/marketplace.json .grok-plugin/ README.md; then | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add .claude-plugin/marketplace.json .grok-plugin/ README.md | |
| git commit -m "chore: auto-sync catalog + regenerate README + Grok plugin-index" | |
| # Concurrent schedule + dispatch + path-push races are common; rebase and retry. | |
| for i in 1 2 3; do | |
| if git push; then | |
| exit 0 | |
| fi | |
| echo "push rejected (race), pull --rebase attempt $i" | |
| git pull --rebase origin main | |
| done | |
| exit 1 | |
| else | |
| echo "already in sync" | |
| fi |