Create Bump Package Version PR #12
This file contains hidden or 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: 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 |