From c4d515f1890a72e97fd614d779af92af2cde1f09 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 3 Dec 2023 21:39:18 +0100 Subject: [PATCH] Update version check script in workflow to prevent issues --- .github/workflows/handle-versioning-accross-branches.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/handle-versioning-accross-branches.yml b/.github/workflows/handle-versioning-accross-branches.yml index 6ef5cfa..3d46d1e 100644 --- a/.github/workflows/handle-versioning-accross-branches.yml +++ b/.github/workflows/handle-versioning-accross-branches.yml @@ -31,10 +31,14 @@ jobs: id: get-version shell: pwsh env: - AZURE_DEVOPS_CREATE_PAT: ${{ secrets.AZURE_DEVOPS_CREATE_PAT}} + AZURE_DEVOPS_PAT: ${{ secrets.AZURE_DEVOPS_PAT}} run: | # get the last updated version for this extension from the server - $output = $(tfx extension show --token $env:AZURE_DEVOPS_CREATE_PAT --vsix $vsix --publisher "RobBos" --extension-id "GHAzDoWidget-DEV" --output json | ConvertFrom-Json) + $output = $(tfx extension show --token $env:AZURE_DEVOPS_PAT --vsix $vsix --publisher "RobBos" --extension-id "GHAzDoWidget-DEV" --output json | ConvertFrom-Json) + if ($null -eq $output) { + Write-Host "No versions found on the server" + exit 1 + } $lastVersion = ($output.versions | Sort-Object -Property lastUpdated -Descending)[0] Write-Host "Last version: [$($lastVersion.version)] from server"