Bump Patch #6
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: Bump Patch | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
bump_version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout develop branch | |
uses: actions/checkout@v4 | |
with: | |
ref: develop | |
- name: Install dependencies | |
run: npm install | |
- name: Push changes | |
run: | | |
git config user.name "github-actions" | |
git config user.email "github-actions@github.com" | |
npm version patch | |
git checkout -b release-version-$(jq -r '.version' package.json) | |
git push --set-upstream origin release-version-$(jq -r '.version' package.json) | |
- name: Create Pull Request | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const { owner, repo } = context.repo; | |
const branchName = `release-version-${require('./package.json').version}`; | |
await github.rest.pulls.create({ | |
owner, | |
repo, | |
title: `feat: Bump version to ${require('./package.json').version}`, | |
head: branchName, | |
base: 'develop', | |
}); |