-
Notifications
You must be signed in to change notification settings - Fork 2
40 lines (35 loc) · 1.06 KB
/
npm-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
name: Bump npm package version
on:
workflow_dispatch:
inputs:
version:
description: Version to bump
required: true
default: "patch"
type: choice
options:
- patch
- minor
- major
jobs:
bump_version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
- name: Bump version
id: bump
run: |
version="$(npm version --no-commit-hooks --no-git-tag-version ${{ inputs.version }})"
echo "version=$version" >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
assignees: ${{ github.actor }}
branch: "version/${{ steps.bump.outputs.version }}"
commit-message: "Bump version to ${{ steps.bump.outputs.version }}"
delete-branch: true
title: "Bump version to ${{ steps.bump.outputs.version }}"