Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/info-needed-closer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ on:
types: [trigger-needs-more-info]
workflow_dispatch:

permissions:
issues: write
permissions: {}

jobs:
main:
Expand All @@ -19,6 +18,7 @@ jobs:
- name: Checkout Actions
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
repository: 'microsoft/vscode-github-triage-actions'
path: ./actions
ref: stable
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/issue-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ on:
env:
TRIAGERS: '["karthiknadig","eleanorjboyd","anthonykim1"]'

permissions:
issues: write
permissions: {}

jobs:
# From https://github.com/marketplace/actions/github-script#apply-a-label-to-an-issue.
Expand All @@ -22,6 +21,7 @@ jobs:
- name: Checkout Actions
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
repository: 'microsoft/vscode-github-triage-actions'
ref: stable
path: ./actions
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/pr-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ jobs:
name: 'Ensure Required Labels'
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
pull-requests: read
steps:
- name: 'PR impact specified'
uses: mheap/github-action-required-labels@23e10fde7e062233401931a0eece796cd9bf3177 # v5.6.0
Expand Down
23 changes: 10 additions & 13 deletions build/templates/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#
# Notes:
# - Azure DevOps Marketplace resource GUID (499b84ac-1321-427f-aa17-267ca6975798) is hardcoded in publish script.
# - This uses Managed Identity via AzureCLI@2 to acquire an AAD token and passes it as a PAT.
# - Each publish step uses the managed identity's AAD token through VSCE_PAT.
# - Requires extension artifacts already signed (signature file present).
# - Node & vsce expected to be prepared by parent pipeline; omit local installation here.
# - The parent pipeline prepares Node and the npm registry; no source checkout is required.
# - Artifacts are expected at: $(Build.ArtifactStagingDirectory)/publishFolder/{platform}/

parameters:
Expand All @@ -47,9 +47,9 @@ parameters:
default: ''

steps:
# Node & vsce expected to be prepared by parent pipeline; omit local installation.

# Assumes files already present at $(Build.ArtifactStagingDirectory)/publishFolder/{platform}/
# Install once, before the Marketplace credential exists on the publish agent.
- pwsh: npm install --global --prefix "$(Agent.TempDirectory)/marketplace-vsce" @vscode/vsce@4.1.1 --no-audit --no-fund
displayName: Install Marketplace publisher

# Step 1: Acquire token only (store secret variable MarketplaceAADToken)
- task: AzureCLI@2
Expand All @@ -71,11 +71,12 @@ steps:
- ${{ each platform in parameters.buildPlatforms }}:
- task: PowerShell@2
displayName: "Publish extension (${{ coalesce(platform.vsceTarget, 'universal') }})"
env:
VSCE_PAT: $(MarketplaceAADToken)
Comment thread
dmitrivMS marked this conversation as resolved.
Resolved
inputs:
targetType: inline
script: |
$aadToken = "$(MarketplaceAADToken)"
if (-not $aadToken) { Write-Error 'MarketplaceAADToken is empty (token acquisition failed).'; exit 1 }
if (-not $env:VSCE_PAT) { Write-Error 'MarketplaceAADToken is empty (token acquisition failed).'; exit 1 }

$platformFolder = "${{ coalesce(platform.vsceTarget, 'universal') }}"
$root = "$(Build.ArtifactStagingDirectory)/${{ parameters.publishFolder }}/$platformFolder"
Expand Down Expand Up @@ -105,14 +106,10 @@ steps:

if ('${{ parameters.preRelease }}' -eq 'True') {
Write-Host 'Publishing as pre-release'
$displayCmd = "Executing: npx @vscode/vsce@latest publish --pat *** --packagePath $vsixPath --manifestPath $manifestPath --signaturePath $signaturePath --no-verify --pre-release"
Write-Host $displayCmd
npx @vscode/vsce@latest publish --pat $aadToken --packagePath $vsixPath --manifestPath $manifestPath --signaturePath $signaturePath --no-verify --pre-release
& "$(Agent.TempDirectory)/marketplace-vsce/vsce.cmd" publish --packagePath $vsixPath --manifestPath $manifestPath --signaturePath $signaturePath --no-verify --pre-release
} else {
Write-Host 'Publishing as stable release'
$displayCmd = "Executing: npx @vscode/vsce@latest publish --pat *** --packagePath $vsixPath --manifestPath $manifestPath --signaturePath $signaturePath --no-verify"
Write-Host $displayCmd
npx @vscode/vsce@latest publish --pat $aadToken --packagePath $vsixPath --manifestPath $manifestPath --signaturePath $signaturePath --no-verify
& "$(Agent.TempDirectory)/marketplace-vsce/vsce.cmd" publish --packagePath $vsixPath --manifestPath $manifestPath --signaturePath $signaturePath --no-verify
}

if ($LASTEXITCODE -ne 0) {
Expand Down
Loading