Skip to content

chore(ci): publish to the Marketplace via OIDC Trusted Publishing - #501

Merged
mtskf merged 7 commits into
mainfrom
chore/publish-oidc
Nov 20, 2026
Merged

mtskf merged 7 commits into
mainfrom
chore/publish-oidc

Conversation

@mtskf

@mtskf mtskf commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Summary

Publish to the VS Code Marketplace with OIDC Trusted Publishing (vsce publish --oidc) instead of the VSCODE_PAT secret. Azure DevOps retires Global PATs on 2027-01-27; the publisher's Trusted Publishing policy (owner mtskf, repo quoll, workflow publish.yml, no environment) now owns auth.

Changes

  • publish.yml Marketplace step: add --oidc, drop the VSCE_PAT: ${{ secrets.VSCODE_PAT }} env, rewrite the step comment to explain the auth model and why.
  • Header comments: id-token: write (already workflow-level, so it covers the publish job) is now documented as serving both Sigstore attestation and the Marketplace OIDC exchange.
  • Open VSX step: behaviour unchanged (OVSX_PAT); only its comment, which pointed at the removed rationale above it, is made standalone.
  • Not touched: token-liveness.yml, any secret, scripts/deploy.sh (local manual publish).

Verification

  • @vscode/vsce 4.0.0 (lockfile-pinned) implements --oidc (out/oidc.js, registered in out/main.js with .hideHelp(true), so it is absent from --help). It needs only GITHUB_ACTIONS=true plus the ACTIONS_ID_TOKEN_REQUEST_URL/TOKEN that id-token: write provides — no azure/login action. It exchanges the token (audience marketplace.visualstudio.com) at /_apis/gallery/token for the publisher in the manifest.
  • pnpm exec vsce publish --oidc --packagePath /nonexistent.vsix parses the flag locally (fails only on the missing file).
  • YAML parses; pnpm vitest run test/build green (250 tests).

Test Plan

  • Next v* release: confirm the "Publish to VS Code Marketplace" step succeeds via OIDC (cannot be proven before a real publish).

🤖 Generated with Claude Code

https://claude.ai/code/session_01XMxzpaDPos6QWGgnGQ7rTZ

Switch the Marketplace step from the VSCODE_PAT secret to
`vsce publish --oidc`. Azure DevOps retires Global PATs on 2027-01-27,
and the publisher's Trusted Publishing policy (mtskf/quoll, publish.yml,
no environment) now owns authentication. The existing workflow-level
`id-token: write` already covers the job; the header comment now names
both of its consumers. Open VSX is unchanged.
…h job

Workflow-level id-token: write exposed the Trusted Publishing credential to
every step, including the third-party SBOM action and the build toolchain.
Split publish.yml into build (gates, SBOM, package, audit, attest, upload)
and publish (needs: build; first-party actions plus pnpm/action-setup only;
downloads the attested .vsix and publishes to Marketplace, then Open VSX).
Top-level permissions are now contents: read only. Tests pin the per-job
permissions, the publish job's action allowlist and the artifact hand-off.
With a file-level Trusted Publishing policy, a token minted in build is
as good as one minted in publish, so build's id-token grant handed
publish authority to anchore/sbom-action and the build toolchain. Build
now holds contents: read only and uploads the audited .vsix with its
SBOM; publish attests the downloaded bytes before either registry step.

Tests pin the new permission sets, step order (download, attest,
Marketplace, Open VSX), the Open VSX command, and the absence of
continue-on-error on both registry steps.
@mtskf
mtskf merged commit 4ec90e2 into main Nov 20, 2026
3 of 4 checks passed
@mtskf
mtskf deleted the chore/publish-oidc branch November 20, 2026 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant