diff --git a/.github/workflows/create-prerelease.yml b/.github/workflows/create-prerelease.yml index 5f84a44..a25a3f4 100644 --- a/.github/workflows/create-prerelease.yml +++ b/.github/workflows/create-prerelease.yml @@ -3,6 +3,11 @@ name: Create Prerelease on: workflow_dispatch: inputs: + update_version: + description: 'Update version number:' + type: boolean + required: true + default: true version_type: description: 'Update branch version by:' type: choice @@ -43,11 +48,17 @@ jobs: shell: pwsh run: | Import-Module ./solution-helper.psm1 -Force - $previousVersion, $newVersion = Update-Version -type ${{ github.event.inputs.version_type }} + if (${{ github.event.inputs.update_version }}) { + $previousVersion, $newVersion = Update-Version -type ${{ github.event.inputs.version_type }} + } else { + $newVersion = Get-Version + $previousVersion = $newVersion + } echo "version_tag=$newVersion" | Out-File -FilePath $env:GITHUB_ENV -Append echo "previous_version_tag=$previousVersion" | Out-File -FilePath $env:GITHUB_ENV -Append - name: Check for Existing Release + if: github.event.inputs.update_version run: | # Fetch the list of releases releases=$(gh release list --json createdAt,tagName --limit 100) @@ -71,6 +82,7 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Update Version Number + if: github.event.inputs.update_version run: | git config --global user.name 'github-actions' git config --global user.email 'github-actions@github.com'