Skip to content

Create Bump Package Version PR #12

Create Bump Package Version PR

Create Bump Package Version PR #12

name: Create Bump Package Version PR
on:
workflow_dispatch:
inputs:
new_version:
description: 'New version number (without v prefix)'
required: true
type: string
jobs:
create-bump-version-pr:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name github-actions
git config user.email github-actions@github.com
- name: Bump npm version
run: npm version ${{ github.event.inputs.new_version }} --no-git-tag-version
- name: Commit
run: |
git add package.json package-lock.json
git commit -m "Bump version to v${{ github.event.inputs.new_version }}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
commit-message: 'Bump version to v${{ github.event.inputs.new_version }}'
title: 'Bump version to v${{ github.event.inputs.new_version }}'
body: bump Package Version
branch: 'bump-version-v${{ github.event.inputs.new_version }}'
base: main