Skip to content

Commit

Permalink
Create generate_types.yml action
Browse files Browse the repository at this point in the history
  • Loading branch information
AJXD2 authored Nov 17, 2024
1 parent a3aa140 commit 3f580f3
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/generate_types.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Generate Types

on:
push:
branches:
- "**" # Runs on all branches for any push

jobs:
generate-types:
runs-on: ubuntu-latest

steps:
# Step 1: Check out the code
- name: Checkout code
uses: actions/[email protected]

# Step 2: Set up Python environment
- name: Set up Python
uses: actions/[email protected]
with:
python-version: "3.10"
# Step 3: Pull the JSON repo
- name: Pull the JSON repo
run: |
cd json
git fetch
git merge origin/master
cd ..
# Step 4: Run the generate_types script
- name: Run generate_types.py
run: |
python generate_types.py
# Step 5: Commit changes (if any generated file is updated)
- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add helldivepy/generated_types.py
git commit -m "Automated update: Regenerated types" || echo "No changes to commit"
git push

0 comments on commit 3f580f3

Please sign in to comment.