fix: add supported modes (#647) #330
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: Update README Model Counts | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'providers/**' | |
| jobs: | |
| update-readme: | |
| name: Update provider model counts | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Update README counts | |
| run: npm run update:readme | |
| - name: Check for changes | |
| id: changes | |
| run: | | |
| if git diff --quiet README.md; then | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Create branch, commit and push | |
| if: steps.changes.outputs.changed == 'true' | |
| env: | |
| HUSKY: '0' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git checkout -b readme/update-counts | |
| git add README.md | |
| git commit -m "docs(readme): update provider model counts" | |
| git push --force origin readme/update-counts | |
| - name: Create pull request | |
| if: steps.changes.outputs.changed == 'true' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| pr_count=$(gh pr list --head readme/update-counts --json number -q 'length') | |
| if [ "$pr_count" = "0" ]; then | |
| gh pr create \ | |
| --base main \ | |
| --head readme/update-counts \ | |
| --title "docs(readme): update provider model counts" \ | |
| --body "Auto-generated PR to update README model counts after provider YAML changes. Merge when ready; required status checks will run on this PR." | |
| fi |