-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (45 loc) · 1.26 KB
/
compile-json.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}