Skip to content

Increment Patch Version #3

Increment Patch Version

Increment Patch Version #3

name: Increment Patch Version
on:
workflow_dispatch:
permissions:
contents: write
jobs:
increment-patch:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Read and increment version
run: |
VERSION_FILE=".version"
CURRENT_VERSION=$(cat $VERSION_FILE)
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
PATCH=$((PATCH + 1))
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
echo "$NEW_VERSION" > $VERSION_FILE
echo "Version updated to $NEW_VERSION"
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "CubeDood"
git add .version
git commit -m "Increment patch version"
git push
env:
GITHUB_TOKEN: ${{ secrets.CUBEDOOD_TOKEN }}