Nightly AI Codegen #61
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 AI Codegen | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" # Midnight UTC daily | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: {} | |
| jobs: | |
| codegen: | |
| name: AI Codegen | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| uses: ./.github/actions/setup | |
| - name: Run AI Codegen | |
| run: node packages/tools/ai-codegen/src/bin.ts generate | |
| - name: Check for changes | |
| id: changes | |
| run: | | |
| # Only consider changes in packages/ai/ | |
| providers=$(git diff --name-only | grep "^packages/ai/" | cut -d'/' -f3 | sort -u | sed 's/^/- /' || true) | |
| if [ -z "$providers" ]; then | |
| echo "has_changes=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "has_changes=true" >> $GITHUB_OUTPUT | |
| { | |
| echo "updated_providers<<EOF" | |
| echo "$providers" | |
| echo "EOF" | |
| } >> $GITHUB_OUTPUT | |
| fi | |
| - name: Create Pull Request | |
| if: steps.changes.outputs.has_changes == 'true' | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: chore/ai-codegen-update | |
| delete-branch: true | |
| title: "chore: update AI codegen generated files" | |
| body: | | |
| Automated update of AI provider generated code. | |
| ## Updated Providers | |
| ${{ steps.changes.outputs.updated_providers }} | |
| --- | |
| *This PR was automatically generated by the nightly codegen workflow.* | |
| commit-message: "chore: regenerate AI provider code" | |
| labels: automated |