Skip to content

Create Release PR

Create Release PR #22

name: Create Release PR
on:
workflow_dispatch:
inputs:
version:
type: choice
description: 'version to bump'
required: true
options:
[
'patch',
'minor',
'major',
'prepatch',
'preminor',
'premajor',
'prerelease'
]
default: 'patch'
jobs:
bump-version-create-pr:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: Bump and create PR
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
yarn workspace @dvcorg/gatsby-theme-iterative version --${{ github.event.inputs.version }} --no-git-tag-version
VERSION=$(jq -r '.version' < packages/gatsby-theme-iterative/package.json)
git checkout -b bump-theme-package/v${VERSION}
git add .
git commit -m "Bump version to v${VERSION}"
git push --set-upstream origin HEAD
gh pr create --title "Bump version to v${VERSION}" --body "Approve me 🤖
Please close and reopen this PR to run the required workflows.
**Once workflows are enabled. The `publish` workflow will run automatically when this PR is merged.**
Else, we can run it manually from the Actions tab.
"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}