Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/check-deprecated-models.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Check for Deprecated Models

on:
schedule:
# Run once a week on Monday at 00:00 UTC
- cron: '0 0 * * 1'
workflow_dispatch: # Allow manual triggering

jobs:
check-models:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9

- name: Install dependencies
run: pnpm install

- name: Build Genkit libraries
run: pnpm build:js

- name: Run check-deprecated-models script
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
run: npx tsx scripts/check-deprecated-models.ts

- name: Create Pull Request if files changed
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "Changes detected. Creating PR..."

# Setup Git config
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

# Create a new branch
BRANCH_NAME="chore/update-deprecated-models-$(date +%s)"
git checkout -b "$BRANCH_NAME"

# Commit changes
git commit -am "chore: update deprecated Gemini models"

# Push branch
git push origin "$BRANCH_NAME"

# Create PR
gh pr create \
--title "chore: update deprecated Gemini models" \
--body "This PR was automatically generated by the \`check-deprecated-models.yml\` workflow. It scans the provided Google AI and Vertex AI documentation URLs to identify deprecated Gemini models and replaces their exact string identifiers in the codebase." \
--head "$BRANCH_NAME" \
--base main
else
echo "No changes detected. No PR needed."
fi
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@
"format:check"
],
"devDependencies": {
"@genkit-ai/core": "^1.30.1",
"@genkit-ai/googleai": "^1.28.0",
"@types/jsdom": "^28.0.1",
"@types/node": "22.10.5",
"inquirer": "^8.2.6",
"jsdom": "^29.0.1",
"npm-run-all": "^4.1.5",
"only-allow": "^1.2.1",
"pre-commit": "^1.2.2",
Expand All @@ -42,7 +46,8 @@
"prettier-plugin-organize-imports": "^3.2.4",
"rimraf": "^6.0.1",
"ts-node": "^10.9.2",
"tsx": "^4.20.3"
"tsx": "^4.20.3",
"zod": "^4.3.6"
},
"pnpm": {
"overrides": {
Expand Down
Loading
Loading