generated from actions/javascript-action
-
Notifications
You must be signed in to change notification settings - Fork 5
35 lines (33 loc) · 1005 Bytes
/
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
on:
pull_request:
types: [assigned]
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} # PAT is necessary to trigger other workflows on push
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
- name: Install dependencies
run: |
npm --global install npm@latest
npm ci
- name: Commit and push a built file if any changes
run: |
if git diff --exit-code; then
echo "No changes."
exit 0
fi
git config --local user.name "${GITHUB_ACTOR}"
git config --local user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add -f dist/index.cjs
git commit --message 'build: update dist/index.cjs'
git push