Repository navigation
Generate and Release Types #15
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: Generate All Types | |
| on: | |
| # Run weekly on Mondays at 10:00 AM UTC | |
| schedule: | |
| - cron: '0 10 * * 1' | |
| # Allow manual triggering | |
| workflow_dispatch: | |
| jobs: | |
| generate: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.REPO_TOKEN }} | |
| persist-credentials: true | |
| fetch-depth: 0 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Run generate-all | |
| env: | |
| DOCS_API_URL: ${{ secrets.DOCS_API_URL }} | |
| DOCS_USERNAME: ${{ secrets.DOCS_USERNAME }} | |
| DOCS_PASSWORD: ${{ secrets.DOCS_PASSWORD }} | |
| run: bun run generate-all | |
| - name: Check for changes | |
| id: check-changes | |
| run: | | |
| if [ -n "$(git status --porcelain)" ]; then | |
| echo "has_changes=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "has_changes=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit changes | |
| if: steps.check-changes.outputs.has_changes == 'true' | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add . | |
| git commit -m "chore: regenerate types and schemas [skip ci]" | |
| git push |