Skip to content

Create Bump PR

Create Bump PR #1

name: 'Create Bump PR'
on:
workflow_dispatch:
inputs:
version:
description: 'New version'
required: true
permissions:
contents: write
pull-requests: write
jobs:
bump:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Create new branch
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git checkout -b chore/bump-version-${{ inputs.version }}
- name: Bump version
run: |
sed -i 's/"version": "[^"]*"/"version": "${{ inputs.version }}"/g' package.json
sed -i 's/"version": "[^"]*"/"version": "${{ inputs.version }}"/g' manifest.webapp
- name: Commit changes
run: |
git add package.json
git add manifest.webapp
git commit -m "chore: Bump version to ${{ inputs.version }}"
- name: Push changes
run: git push origin chore/bump-version-${{ inputs.version }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Pull Request
run: gh pr create -B master -H chore/bump-version-${{ inputs.version }} --title 'Bump ${{ inputs.version }}' --body 'This PR bumps the version to ${{ inputs.version }}.'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}