Skip to content

Code Generation Workflow #7

Code Generation Workflow

Code Generation Workflow #7

Workflow file for this run

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 <noreply@github.com>"
committer: "GitHub Workflow <noreply@github.com>"
reviewers: "Sett17"
body: |
This is an automated pull request to update the model definitions.
signoff: true