| 1 |
# This workflow bumps the package.json version and creates a PR |
| 2 |
|
| 3 |
name: Update package version |
| 4 |
|
| 5 |
on: |
| 6 |
workflow_dispatch: |
| 7 |
inputs: |
| 8 |
segment: |
| 9 |
description: 'Semver segment to update' |
| 10 |
required: true |
| 11 |
default: 'patch' |
| 12 |
type: choice |
| 13 |
options: |
| 14 |
- minor |
| 15 |
- patch |
| 16 |
|
| 17 |
jobs: |
| 18 |
update-version: |
| 19 |
name: Update package version |
| 20 |
runs-on: ubuntu-latest |
| 21 |
steps: |
| 22 |
- uses: actions/checkout@v2 |
| 23 |
- uses: actions/setup-node@v2 |
| 24 |
with: |
| 25 |
node-version: 16 |
| 26 |
- run: echo "Updating ${{ inputs.segment }} version" |
| 27 |
- name: Update version |
| 28 |
run: npm --no-git-tag-version version ${{ inputs.segment }} |
| 29 |
- uses: peter-evans/create-pull-request@v4 |
| 30 |
with: |
| 31 |
base: 'master' |
| 32 |
branch: 'version/automated' |
| 33 |
title: 'Update package version (automated)' |
| 34 |
commit-message: 'Update package version' |
| 35 |
body: 'Automated update to ${{ inputs.segment }} version' |