From 5869d964ee6a09bede16a4953a12dca1719ee7c6 Mon Sep 17 00:00:00 2001 From: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> Date: Fri, 3 May 2024 13:34:45 -0700 Subject: [PATCH] Replace `vsce` PAT with an Azure Credential The latest version of the tool will use the Azure API to grab a token, it just needs to be run in a context where Azure CLI is authenticated. I think. --- .pipelines/vscode-powershell-Official.yml | 26 ++++++++++++----------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.pipelines/vscode-powershell-Official.yml b/.pipelines/vscode-powershell-Official.yml index caec6e96d7..e2e051e08e 100644 --- a/.pipelines/vscode-powershell-Official.yml +++ b/.pipelines/vscode-powershell-Official.yml @@ -190,21 +190,23 @@ extends: pool: type: windows variables: - - group: VSCodeMarketplace - - name: ob_outputDirectory - value: $(Build.SourcesDirectory)/out + ob_outputDirectory: $(Build.SourcesDirectory)/out steps: - download: current displayName: Download artifacts - pwsh: npm ci displayName: Install NPM packages (for vsce) - - pwsh: | - $publishArgs = @( - '--pat' - '$(token)' - '--packagePath' - '$(drop)/powershell-$(vsixVersion).vsix' - if ([bool]::Parse('$(prerelease)')) { '--pre-release' } - ) - npm run publish -- @publishArgs + - task: AzureCLI@2 displayName: Run vsce publish + inputs: + azureSubscription: vscode-marketplace + scriptType: pscore + scriptLocation: inlineScript + inlineScript: | + $publishArgs = @( + '--azure-credential' + '--packagePath' + '$(drop)/powershell-$(vsixVersion).vsix' + if ([bool]::Parse('$(prerelease)')) { '--pre-release' } + ) + npm run publish -- @publishArgs