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 if: github.repository_owner == 'Effect-Ts' runs-on: namespace-profile-linux-small permissions: contents: write pull-requests: write timeout-minutes: 15 steps: - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # 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<> $GITHUB_OUTPUT fi - name: Create Pull Request if: steps.changes.outputs.has_changes == 'true' uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # 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