Skip to content

Commit

Permalink
Merge pull request #4787 from wso2/jeradrutnam-patch-3
Browse files Browse the repository at this point in the history
Update release-docs.yml
  • Loading branch information
jeradrutnam authored Sep 27, 2024
2 parents 4b26b5f + 1bb4a5d commit a927e21
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/release-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
paths-ignore:
- 'VERSION' # This will ignore changes only to the VERSION file.
workflow_dispatch:
inputs:
version:
description: 'Version to tag (e.g., 0.0.1). Leave empty to use CURRENT_VERSION from environment.'
required: false # This input is optional
default: ''

env: # Global environment variables
GIT_USERNAME: ${{ secrets.GIT_USERNAME }}
Expand Down Expand Up @@ -43,11 +48,17 @@ jobs:
- name: Increment version
run: |
set -euxo pipefail
IFS='.' read -r MAJOR MINOR PATCH <<< "${{ env.CURRENT_VERSION }}"
echo "Current version: MAJOR=$MAJOR, MINOR=$MINOR, PATCH=$PATCH"
PATCH=$((PATCH+1))
NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"
NEW_VERSION="${{ github.event.inputs.version }}"
if [[ -z "$VERSION" ]]; then
set -euxo pipefail
IFS='.' read -r MAJOR MINOR PATCH <<< "${{ env.CURRENT_VERSION }}"
echo "Current version: MAJOR=$MAJOR, MINOR=$MINOR, PATCH=$PATCH"
PATCH=$((PATCH+1))
NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"
echo "Version is auto incremented."
fi
echo "New version: $NEW_VERSION"
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
shell: bash
Expand Down

0 comments on commit a927e21

Please sign in to comment.