nightly schema generator #183
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: "nightly schema generator" | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: 0 0 * * * | |
| env: | |
| GIT_AUTHOR_NAME: Recap Time Bot | |
| GIT_AUTHOR_EMAIL: "[email protected]" | |
| jobs: | |
| nightly: | |
| permissions: | |
| contents: write | |
| actions: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout this repo first | |
| uses: actions/[email protected] | |
| - name: Then clone the workers-sdk repo | |
| uses: actions/[email protected] | |
| id: metadata | |
| with: | |
| repository: cloudflare/workers-sdk | |
| path: workers-sdk | |
| ref: main | |
| - name: Setup Node.js environment (uses latest LTS release) | |
| uses: actions/[email protected] | |
| with: | |
| node-version: 22 | |
| - name: Setup pnpm | |
| uses: pnpm/[email protected] | |
| with: | |
| version: 9.12.0 | |
| - name: Generate config schema | |
| run: | | |
| cd ${{github.workspace}}/workers-sdk && pnpm install | |
| cd ${{github.workspace}}/workers-sdk/packages/wrangler | |
| pnpm run generate-json-schema | |
| cp ${{github.workspace}}/workers-sdk/packages/wrangler/config-schema.json ${{github.workspace}}/config-schema.json | |
| - name: Commit and push | |
| run: | | |
| echo "::group::Configuring git" | |
| git config --global user.name "${{ env.GIT_AUTHOR_NAME }}" | |
| git config --global user.email "${{ env.GIT_AUTHOR_EMAIL }}" | |
| echo "::endgroup::" | |
| git stage config-schema.json | |
| git commit --signoff \ | |
| -m "generate workers config schema from workers-sdk repo" \ | |
| -m "Commit-Id: https://github.com/cloudflare/workers-sdk/commit/${{steps.metadata.outputs.commit}}" \ | |
| -m "Co-authored-by: Andrei Jiroh Halili <[email protected]>" | |
| git push |