Update AI Models #80
This file contains 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 AI Models | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Runs every day at midnight | |
workflow_dispatch: # Allows manual triggering | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
update-models: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: npm install | |
- name: Fetch latest JSON file | |
run: node fetchLatestJson.js | |
- name: Run transformModels.js | |
run: node transformModels.js | |
- name: Commit and push changes | |
run: | | |
git config --global user.name 'Ahmet Dedeler' | |
git config --global user.email '[email protected]' | |
git add . | |
if git commit -m 'Update AI models'; then | |
git push | |
else | |
echo "No changes to commit" | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} |