Skip to content

Commit 7ef5dff

Browse files
committed
Use create-pull-request action for dist updates
1 parent bef7b29 commit 7ef5dff

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

.github/workflows/package.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
1-
on:
2-
push:
3-
branches:
4-
- master
5-
61
name: Package
72

8-
permissions:
9-
contents: write
3+
on:
4+
pull_request:
105

116
jobs:
12-
check:
7+
build:
138
name: Package distribution file
149
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
pull-requests: read
1513
steps:
1614
- name: Checkout
17-
uses: actions/checkout@v3
15+
uses: actions/checkout@v4
1816
with:
19-
ref: master
17+
ref: ${{ github.event.pull_request.head.ref }}
2018
- name: Package
2119
run: |
2220
npm ci
2321
npm test
2422
npm run all
25-
- name: Commit
23+
- name: Commit to PR
24+
if: github.actor == 'dependabot[bot]'
2625
run: |
2726
git config --global user.name "GitHub Actions"
2827
git add dist/
2928
git commit -m "(chore) updating dist" || echo "No changes to commit"
30-
git push origin HEAD:master
29+
git push
30+
- name: Check dist is up-to-date
31+
if: github.actor != 'dependabot[bot]'
32+
run: |
33+
git diff --exit-code dist/

0 commit comments

Comments
 (0)