1+ name : AI Translate Python to JS 
2+ 
3+ on :
4+   push :
5+     branches :
6+       - wzrdbrain  #  Matches the deploy workflow branch
7+     paths :
8+       - ' src/wzrdbrain/wzrdbrain.py' 
9+       - ' src/wzrdbrain/tricks.json' 
10+       - ' .github/workflows/translate2js.yml' 
11+   workflow_dispatch :
12+ 
13+ jobs :
14+   translate_and_commit :
15+     runs-on : ubuntu-latest 
16+ 
17+     steps :
18+       - name : Checkout repository 
19+         uses : actions/checkout@v4 
20+ 
21+       - name : Set up Python 
22+         uses : actions/setup-python@v5 
23+         with :
24+           python-version : ' 3.13' 
25+ 
26+       - name : Install dependencies 
27+         run : pip install google-genai 
28+ 
29+       - name : Translate Python to JavaScript 
30+         run : python scripts/translate.py 
31+         env :
32+           GEMINI_API_KEY : ${{ secrets.GEMINI_API_KEY }} 
33+ 
34+       - name : Show first lines of generated file 
35+         run : | 
36+           echo "Preview of dist/wzrdbrain.src.js:" 
37+           head -n 60 dist/wzrdbrain.src.js || true  
38+ 
39+ name : Upload artifact for review 
40+         uses : actions/upload-artifact@v4 
41+         with :
42+           name : wzrdbrain-js 
43+           path : dist/wzrdbrain.src.js 
44+ 
45+       - name : Create Pull Request with generated file 
46+         uses : peter-evans/create-pull-request@v6 
47+         with :
48+           commit-message : " chore: generate dist/wzrdbrain.js via utils/translate2js.py" 
49+           title : " chore: generate wzrdbrain.js via utils/translate2js.py" 
50+           body : | 
51+             This PR was generated by GitHub Actions using utils/translate2js.py. 
52+             - Source: wzrdbrain.py (+ tricks.json if used) 
53+             - Output: dist/wzrdbrain.js 
54+ branch : chore/translate-wzrdbrain 
55+           add-paths : | 
56+             dist/wzrdbrain.js 
0 commit comments