Skip to content

Commit

Permalink
Create bump-version.yml
Browse files Browse the repository at this point in the history
Signed-off-by: HlexNC <[email protected]>
  • Loading branch information
HlexNC committed Apr 21, 2024
1 parent 848e610 commit 6146ce9
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Bump Version Workflow

on:
pull_request:
types: [opened, synchronize, labeled, unlabeled]
branches:
- main
paths:
- 'document-conversion/package.json'
- 'document-conversion/package-lock.json'

jobs:
bump-version:
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' && contains(github.event.pull_request.labels.*.name, 'Upgrade: Bump') && contains(github.event.pull_request.title, 'Upgrade: Bump') && contains(github.event.pull_request.title, '/document-conversion') }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Install npm dependencies
run: npm install
working-directory: ./document-conversion

- name: Bump Version
id: bump
run: |
cd document-conversion
npm version patch --no-git-tag-version
echo "New version $(cat package.json | jq -r '.version')"
env:
CI: true

- name: Commit and push changes
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git add document-conversion/package.json document-conversion/package-lock.json
git commit -m "chore: bump version [skip ci]"
git push

0 comments on commit 6146ce9

Please sign in to comment.