Generate Model and Commit #82
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: Generate Model and Commit | |
on: | |
schedule: | |
- cron: '0 0 * * *' # every day at midnight | |
# push: | |
# branches: | |
# - main | |
jobs: | |
generate_model: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install dependencies | |
run: | | |
pip install .[generate_models] | |
- name: Set up Chrome and ChromeDriver | |
uses: browser-actions/[email protected] | |
with: | |
install-chromedriver: true | |
- name: Run generate_models.py | |
run: | | |
python duck_chat/models/generate_models.py | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
commit-message: Auto-generated model_type.py | |
title: Update Models | |
branch: update-models | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |