name: VS Code publisher setup # One-time help for publishing to the VS Code Marketplace with Microsoft Entra ID (CONTRIBUTING.md, "Publishing the # VS Code extension"): signs in as the managed identity the release uses and shows the profile id to add as a member # of the Marketplace publisher. Run it again with the publisher id once the member is added, to check access. on: workflow_dispatch: inputs: publisher: description: Marketplace publisher id to check the identity's access to (leave empty the first time) required: false type: string permissions: contents: read jobs: identity: name: Marketplace identity runs-on: ubuntu-latest # The same environment as the release job, so the same federated credential applies. environment: vscode-marketplace permissions: contents: read id-token: write steps: # Before signing in, so a malformed id never reaches a step that holds a credential. The pattern is vsce's own # rule for publisher names. The message leaves the value out, so it cannot inject a workflow command. - name: Check the publisher id if: inputs.publisher != '' env: PUBLISHER: ${{ inputs.publisher }} run: | if ! [[ "$PUBLISHER" =~ ^[A-Za-z0-9][A-Za-z0-9-]*$ ]]; then echo "::error::the publisher input is not a Marketplace publisher id (letters, digits and hyphens)" exit 1 fi - uses: azure/login@a641126d1b8aa4d1fa005f4f92df94a3a4c4c906 # v3.1.0 with: client-id: ${{ vars.AZURE_CLIENT_ID }} tenant-id: ${{ vars.AZURE_TENANT_ID }} allow-no-subscriptions: true - name: Profile id to add as a publisher member run: | # 499b84ac-… is Azure DevOps, which the Marketplace belongs to. The id is not a secret. id=$(az rest -u https://app.vssps.visualstudio.com/_apis/profile/profiles/me \ --resource 499b84ac-1321-427f-aa17-267ca6975798 --query id -o tsv) echo "profile id: $id" { echo "### Marketplace member" echo echo "At https://marketplace.visualstudio.com/manage, open the publisher, then **Members** → **Add**, and add" echo "\`$id\` with the **Contributor** role. (Not the client id.)" } >> "$GITHUB_STEP_SUMMARY" - if: inputs.publisher != '' uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - if: inputs.publisher != '' uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 - if: inputs.publisher != '' uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: '24' cache: pnpm - name: Check access to the publisher if: inputs.publisher != '' env: PUBLISHER: ${{ inputs.publisher }} run: | pnpm install --frozen-lockfile --ignore-scripts # Passes for any member role; publishing needs Contributor. cd packages/vscode && pnpm exec vsce verify-pat "$PUBLISHER" --azure-credential