-
Notifications
You must be signed in to change notification settings - Fork 2.8k
42 lines (39 loc) · 1.28 KB
/
update_version.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
36
37
38
39
40
41
42
name: Update the npm package version
on:
workflow_dispatch:
inputs:
version:
required: true
type: choice
description: Version type
default: patch
options:
- major
- minor
- patch
- premajor
- preminor
- prepatch
- prerelease
jobs:
update_version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- id: bump_version
run: |
echo "old_version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
npm version ${{ github.event.inputs.version }} --no-git-tag-version
echo "new_version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
- uses: peter-evans/create-pull-request@v4
with:
title: Bump package.json version to v${{ steps.bump_version.outputs.new_version }}}
body: |
Bump package.json version from `v${{ steps.bump_version.outputs.old_version }}` to `v${{ steps.bump_version.outputs.new_version }}`
commit-message: Bump package.json version to v${{ steps.bump_version.outputs.new_version }}
branch: npm-version-bump
base: master