File tree Expand file tree Collapse file tree 2 files changed +36
-11
lines changed
Expand file tree Collapse file tree 2 files changed +36
-11
lines changed Original file line number Diff line number Diff line change 1+ name : Build dist
2+
3+ on :
4+ pull_request :
5+ types : [ labeled ]
6+
7+ jobs :
8+ build :
9+ if : ${{ github.event.label.name == 'build-dist' }}
10+ runs-on : ubuntu-latest
11+ permissions :
12+ contents : write
13+ steps :
14+ - uses : actions/checkout@v4
15+ with :
16+ ref : ${{ github.event.pull_request.head.ref }}
17+ - name : Setup Node.js 20.x
18+ uses : actions/setup-node@v4
19+ with :
20+ node-version : 20.x
21+ cache : ' npm'
22+ - run : npm ci --legacy-peer-deps
23+ - run : npm run build
24+ - name : Commit changes if any in dist/
25+ run : |
26+ if [ -n "$(git status --porcelain dist/)" ]; then
27+ echo "Changes detected in dist/"
28+ git add dist/
29+ git config --global user.name "github-actions"
30+ git config --global user.email "github-actions@github.com"
31+ git commit -m "Generate dist"
32+ git push origin ${{ github.event.pull_request.head.ref }}
33+ else
34+ echo "No changes"
35+ fi
Original file line number Diff line number Diff line change 2626 uses : actions/setup-node@v4
2727 with :
2828 node-version : 20.x
29- - name : Determine npm cache directory
30- id : npm-cache
31- run : |
32- echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
33- - name : Restore npm cache
34- uses : actions/cache@v4
35- with :
36- path : ${{ steps.npm-cache.outputs.dir }}
37- key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
38- restore-keys : |
39- ${{ runner.os }}-node-
29+ cache : ' npm'
4030 - run : npm ci --legacy-peer-deps
4131 - name : Prettier Format Check
4232 run : npm run format-check
You can’t perform that action at this time.
0 commit comments