Skip to content

Commit 7c1decb

Browse files
committed
fix: npm publish
1 parent 8a3c724 commit 7c1decb

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

.github/workflows/npm-publish.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
required: true
1111
default: patch
1212

13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
1317
jobs:
1418
publish:
1519
runs-on: ubuntu-latest
@@ -88,10 +92,23 @@ jobs:
8892
package.json > _tmp.json && mv _tmp.json package.json
8993
npm install --package-lock-only
9094
91-
- name: Commit version bump
95+
- name: Commit version bump and create PR
9296
run: |
9397
git config user.name "github-actions[bot]"
9498
git config user.email "github-actions[bot]@users.noreply.github.com"
99+
BRANCH="chore/bump-npm-v${{ steps.version_docsgpt.outputs.version }}"
100+
git checkout -b "$BRANCH"
95101
git add package.json package-lock.json
96102
git commit -m "chore: bump npm libraries to v${{ steps.version_docsgpt.outputs.version }}"
97-
git push
103+
git push origin "$BRANCH"
104+
env:
105+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
106+
107+
- name: Create PR
108+
run: |
109+
gh pr create \
110+
--title "chore: bump npm libraries to v${{ steps.version_docsgpt.outputs.version }}" \
111+
--body "Automated version bump after npm publish." \
112+
--base main
113+
env:
114+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)