diff --git a/.github/workflows/create-bump-pr.yml b/.github/workflows/create-bump-pr.yml new file mode 100644 index 00000000..72e8b0fc --- /dev/null +++ b/.github/workflows/create-bump-pr.yml @@ -0,0 +1,41 @@ +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 'actions@github.com' + 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 }}