Update Schema #34
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: Update Schema | |
| on: | |
| schedule: | |
| # Run weekly on Sundays at 8:00 AM UTC | |
| - cron: '0 8 * * 0' | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| update-schema: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Update docs SHA | |
| run: npm run update-docs | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Generate new schema | |
| run: npm run generate | |
| - name: Format | |
| run: npm run format | |
| - name: Check for changes | |
| id: check-changes | |
| run: | | |
| if git diff --quiet dist/schema.json config.json; then | |
| echo "has-changes=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "has-changes=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Create Pull Request | |
| if: steps.check-changes.outputs.has-changes == 'true' | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| commit-message: 'Update docs SHA and regenerate OpenAPI schema' | |
| title: 'Update docs SHA and regenerate OpenAPI schema' | |
| body: | | |
| This PR was automatically generated by the weekly schema update workflow. | |
| Changes include: | |
| - Updated mastodon/documentation commit SHA to latest | |
| - Regenerated OpenAPI schema based on the latest Mastodon documentation | |
| Please review the changes and merge if they look correct. | |
| branch: update-schema | |
| delete-branch: true |