Code Generation Workflow #6
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: Code Generation Workflow | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 1 * *' # Runs at 00:00 on the first day of every month | |
jobs: | |
generate-and-create-pr: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install Python dependencies | |
run: | | |
pip install -r code-gen/requirements.txt | |
pip install toml | |
- name: Run code generation script | |
run: | | |
python code-gen/gen.py | |
- name: Extract Version from Cargo.toml | |
run: | | |
version=$(python -c "import toml; print(toml.load('Cargo.toml')['package']['version'])") | |
echo "VERSION=$version" >> $GITHUB_ENV | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
title: "Automated Model Update" | |
commit-message: "Automated update of model definitions" | |
branch: "update-models-${{ env.VERSION }}" | |
author: "GitHub Workflow <[email protected]>" | |
committer: "GitHub Workflow <[email protected]>" | |
reviewers: "Sett17" | |
body: | | |
This is an automated pull request to update the model definitions. | |
signoff: true |