Sync Registry Docs #170
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 Registry Docs | |
| on: | |
| # Allow manual trigger | |
| workflow_dispatch: | |
| # Run hourly to pick up registry changes | |
| schedule: | |
| - cron: "15 * * * *" # Every hour at :15 | |
| jobs: | |
| sync: | |
| name: Sync Registry Documentation | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Set up Node.js | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4 | |
| with: | |
| node-version: latest | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Generate registry docs | |
| run: python scripts/generate_registry_docs.py | |
| - name: Format generated files | |
| run: npx prettier --write docs/get-started/registry.mdx | |
| - name: Check for changes | |
| id: changes | |
| run: | | |
| if git diff --quiet docs/get-started/registry.mdx; then | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| fi | |
| # Generating a GitHub token, so that PRs and tags created by | |
| # the action can trigger actions workflows. | |
| - name: Generate GitHub token | |
| uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf | |
| id: generate-token | |
| with: | |
| # GitHub App ID secret name | |
| app-id: ${{ secrets.RELEASE_PLZ_APP_ID }} | |
| # GitHub App private key secret name | |
| private-key: ${{ secrets.RELEASE_PLZ_APP_PRIVATE_KEY }} | |
| - name: Create Pull Request | |
| id: cpr | |
| if: steps.changes.outputs.changed == 'true' | |
| uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v6 | |
| with: | |
| token: ${{ steps.generate-token.outputs.token }} | |
| commit-message: "docs: update registry agents" | |
| title: "docs: update registry agents" | |
| body: | | |
| This PR updates the registry documentation with the latest agents from the ACP Registry CDN. | |
| Auto-generated by the sync-registry workflow. | |
| branch: auto/sync-registry | |
| delete-branch: true | |
| labels: documentation | |
| - name: Enable auto-merge | |
| if: steps.cpr.outputs.pull-request-number | |
| run: gh pr merge --squash --auto "${{ steps.cpr.outputs.pull-request-number }}" | |
| env: | |
| GH_TOKEN: ${{ steps.generate-token.outputs.token }} |