Create SimpleProgram.js #19
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: Build and Process JSON | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '**.js' | |
- '**.ts' | |
- '**.module.json' | |
pull_request: | |
branches: | |
- main | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 'latest' | |
- name: Install dependencies and transpile TypeScript | |
run: cd compiler && npm install && npx tsc --noCheck && cd .. | |
- name: Find and process *.module.json files | |
run: | | |
find . -name '*.module.json' | while read path; do | |
node compiler/dist/cli ?json "$path" | |
done | |
- name: Commit generated code | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config user.name "GitHub Actions Bot" | |
git config user.email "<>" | |
git add -A | |
git diff --quiet && git diff --staged --quiet || git commit -m "Generated code" | |
git pull --rebase | |
- name: Push changes | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |