diff --git a/.github/workflows/shared-increase-version-number.yaml b/.github/workflows/shared-increase-version-number.yaml index a242a3f3..e8aa09fa 100644 --- a/.github/workflows/shared-increase-version-number.yaml +++ b/.github/workflows/shared-increase-version-number.yaml @@ -45,7 +45,7 @@ jobs: - name: Set version number id: version - uses: IABTechLab/uid2-shared-actions/actions/version_number@v2 + uses: IABTechLab/uid2-shared-actions/actions/version_number@add-missing-patch-calculation with: type: ${{ inputs.release_type }} version_number: ${{ inputs.version_number_input }} @@ -89,4 +89,4 @@ jobs: script: | console.log('Result', '${{ steps.commit-and-tag.outcome }}'); console.log('Commit and tag', '${{ steps.commit-and-tag.outputs.git_tag_or_hash }}'); - console.log('No tag', '${{ steps.commit-without-tag.outputs.git_tag_or_hash }}'); \ No newline at end of file + console.log('No tag', '${{ steps.commit-without-tag.outputs.git_tag_or_hash }}'); diff --git a/actions/version_number/action.yaml b/actions/version_number/action.yaml index 87d91d95..2bd80cca 100644 --- a/actions/version_number/action.yaml +++ b/actions/version_number/action.yaml @@ -79,6 +79,14 @@ runs: else echo "new_version=$NBGV_SimpleVersion-SNAPSHOT" >> $GITHUB_OUTPUT fi + elif [[ "${{ inputs.type }}" == "Patch" ]]; then + CURRENT_PATCH=$(echo $NBGV_SimpleVersion | awk -F. '{print $3}') + HEIGHT=$NBGV_VersionHeight + if [[ $HEIGHT -lt 1 ]]; then + HEIGHT=1 + fi + NEW_PATCH=$(($CURRENT_PATCH + $HEIGHT)) + echo "new_version=$NBGV_MajorMinorVersion.$NEW_PATCH" >> $GITHUB_OUTPUT elif [[ "$BRANCH_NAME" =~ ^release.* ]]; then git fetch --tags --all # Find the base tag that the branch derived from