Skip to content

feat(ci): auto bump version on merge #2

feat(ci): auto bump version on merge

feat(ci): auto bump version on merge #2

Workflow file for this run

name: Bump Package Version
on:
pull_request:
branches: [main]
types: [closed]
jobs:
bump-version:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: yarn install
- name: Bump version
run: yarn bump-version
- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add package.json
git diff --cached --quiet && echo "No version change." || git commit -m "chore(release): bump version [skip ci]"
git push