-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
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
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 |