@@ -45,65 +45,50 @@ jobs:
4545 echo "exit_code=$EXIT_CODE" >> $GITHUB_OUTPUT
4646 exit 0
4747
48- - name : Commit and push to branch
48+ - name : Create Pull Request
4949 if : steps.check-models.outputs.exit_code == '1'
50- run : |
51- git config user.name "github-actions[bot]"
52- git config user.email "github-actions[bot]@users.noreply.github.com"
53- git checkout -b sync-ai-models-${{ github.run_number }}
54- git add packages/openops/src/lib/ai/providers/
55- if git diff --staged --quiet; then
56- echo "No changes to commit"
57- exit 0
58- fi
59- git commit -m "Update AI provider models from models.dev"
60- git push origin sync-ai-models-${{ github.run_number }}
61-
62- # Commented out for testing - uncomment when ready to auto-create PRs
63- # - name: Create Pull Request
64- # if: steps.check-models.outputs.exit_code == '1'
65- # id: create-pr
66- # uses: peter-evans/create-pull-request@v7
67- # with:
68- # token: ${{ secrets.GITHUB_TOKEN }}
69- # base: main
70- # commit-message: 'Update AI provider models from models.dev'
71- # title: 'Update AI Provider Models'
72- # body: |
73- # ## 🤖 Automated Model Sync
74- #
75- # This PR updates AI provider model lists based on the latest data from [models.dev](https://models.dev).
76- #
77- # **Review the file changes** to see which models were added or removed for each provider.
78- #
79- # ### What to Check
80- #
81- # - ✅ New models are legitimate and available
82- # - ✅ Removed models are actually deprecated/retired
83- # - ✅ Model IDs match provider documentation
84- #
85- # ### Testing Locally
86- #
87- # ```bash
88- # npx tsx packages/openops/src/lib/ai/sync-models.ts
89- # ```
90- #
91- # ---
92- #
93- # 🔗 **Source**: https://models.dev/api.json (MIT License)
94- # branch: sync-ai-models-${{ github.run_number }}
95- # delete-branch: true
96- # labels: |
97- # dependencies
98- # automated
50+ id : create-pr
51+ uses : peter-evans/create-pull-request@v7
52+ with :
53+ token : ${{ secrets.GITHUB_TOKEN }}
54+ base : main
55+ commit-message : ' Update AI provider models from models.dev'
56+ title : ' Update AI Provider Models'
57+ body : |
58+ ## 🤖 Automated Model Sync
59+
60+ This PR updates AI provider model lists based on the latest data from [models.dev](https://models.dev).
61+
62+ **Review the file changes** to see which models were added or removed for each provider.
63+
64+ ### What to Check
65+
66+ - ✅ New models are legitimate and available
67+ - ✅ Removed models are actually deprecated/retired
68+ - ✅ Model IDs match provider documentation
69+
70+ ### Testing Locally
71+
72+ ```bash
73+ npx tsx packages/openops/src/lib/ai/sync-models.ts
74+ ```
75+
76+ ---
77+
78+ 🔗 **Source**: https://models.dev/api.json (MIT License)
79+ branch : sync-ai-models-${{ github.run_number }}
80+ delete-branch : true
81+ labels : |
82+ dependencies
83+ automated
9984
10085 - name : Summary
10186 if : always()
10287 run : |
10388 if [ "${{ steps.check-models.outputs.exit_code }}" == "0" ]; then
10489 echo "✅ All AI provider models are up to date!" >> $GITHUB_STEP_SUMMARY
10590 elif [ "${{ steps.check-models.outputs.exit_code }}" == "1" ]; then
106- echo "🔄 Model updates detected and branch created: sync-ai-models-${{ github.run_number }} " >> $GITHUB_STEP_SUMMARY
91+ echo "🔄 Model updates detected and PR created" >> $GITHUB_STEP_SUMMARY
10792 else
10893 echo "❌ Sync script failed with unexpected error" >> $GITHUB_STEP_SUMMARY
10994 exit 1
0 commit comments