Skip to content

Revert "[BUGFIX] Change configuration translation" #41

Revert "[BUGFIX] Change configuration translation"

Revert "[BUGFIX] Change configuration translation" #41

name: Update Version on Merge
on:
pull_request:
types: [ closed ]
branches:
- main
permissions:
contents: write
jobs:
update-version:
if: ${{ github.event.pull_request.merged == true }} # Check if the PR is merged
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
token: ${{ secrets.GH_TOKEN }}
- name: Switch to the main branch
run: git checkout main
- name: Set up Node.js
uses: actions/[email protected]
with:
node-version: 'latest'
- name: Determine version bump
id: version_bump
run: |
if [[ "${{ github.event.pull_request.title }}" == *"[BUGFIX]"* ]]; then
echo "news=patch" >> $GITHUB_ENV
elif [[ "${{ github.event.pull_request.title }}" == *"[MINORFEATURE]"* ]]; then
echo "news=minor" >> $GITHUB_ENV
elif [[ "${{ github.event.pull_request.title }}" == *"[MAJORFEATURE]"* ]]; then
echo "news=major" >> $GITHUB_ENV
else
echo "news=none" >> $GITHUB_ENV
fi
- name: Commit and push changes
if: env.news != 'none'
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
npm version ${{ env.news }}
git push --follow-tags
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}