Update package version #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update package version | |
on: | |
workflow_dispatch: | |
inputs: | |
version-increment-type: | |
description: "What would you like to increment? Major, minor or patch?" | |
required: true | |
default: "patch" | |
type: choice | |
options: | |
- major | |
- minor | |
- patch | |
jobs: | |
increment-version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 22 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.14.0 | |
cache: "yarn" | |
- name: Increment package version | |
run: | | |
git log | |
git config user.name 'GHA Workflow' | |
git config user.email '-' | |
npm version ${{ github.event.inputs.version-increment-type }} | |
git log | |
git checkout -b package-version-update | |
git push --follow-tags --force origin package-version-update | |
- name: Create Pull Request | |
run: | | |
gh pr create --base main --head package-version-update --title "Update package version" --body "This PR was created automatically." | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |