Create Release PR #25
This file contains 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 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@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- 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 }} |