generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 4
35 lines (34 loc) · 1.03 KB
/
update-dist.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
name: 'Update dist folder'
on:
push:
branches-ignore: renovate/*
jobs:
dist-changed:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install dependencies
run: |
npm install
- name: Package (update dist folder)
run: |
npm run update-dist
- name: Did dist folder changed?
run: |
EXIT_CODE=0
git update-index --refresh dist/* && git diff-index --quiet HEAD dist || EXIT_CODE=$?
# Set environment variable
echo "EXIT_CODE_DIST_CHANGED=$EXIT_CODE" >> $GITHUB_ENV
- name: Commit dist folder
if: ${{ env.EXIT_CODE_DIST_CHANGED == 1 }}
run: |
git config --global user.name 'Octocat'
git config --global user.email '[email protected]'
git add dist/
git commit -m "🧹 Update dist folder"
git push