Skip to content

fix(vscode): keep marketplace PAT out of argv - #983

Open
WNZhao wants to merge 1 commit into
profullstack:masterfrom
WNZhao:fix/vsce-pat-env
Open

fix(vscode): keep marketplace PAT out of argv#983
WNZhao wants to merge 1 commit into
profullstack:masterfrom
WNZhao:fix/vsce-pat-env

Conversation

@WNZhao

@WNZhao WNZhao commented Aug 24, 2026

Copy link
Copy Markdown

Summary

  • pass the VS Code Marketplace PAT through the official VSCE_PAT environment variable
  • remove --pat <token> from the spawned command arguments
  • add a regression that proves the token never appears in argv

Bug

The target supplied VSCE_TOKEN as a --pat command argument. On a non-zero exit, sh1pt core includes the complete argument list in the thrown error, exposing the Marketplace PAT in logs and CI output. The official @vscode/vsce CLI defaults its PAT from VSCE_PAT, so the token does not need to be present in argv.

Validation

  • failing-before test captured the PAT in argv
  • pnpm exec vitest run packages/targets/plugin-vscode/src/index.test.ts --reporter=dot (7/7)
  • pnpm --filter @profullstack/sh1pt-target-plugin-vscode typecheck
  • git diff --check

Official behavior: https://github.com/microsoft/vscode-vsce/blob/main/src/main.ts


it('passes the marketplace PAT through the child environment instead of argv', async () => {
execMock.mockResolvedValue({ exitCode: 0, stdout: '', stderr: '' });
const token = 'secret-marketplace-pat';
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.

2 participants