Skip to content

Limit marketplace publishing tokens to the publish steps - #1297

Merged
fredericoo merged 3 commits into
mainfrom
gg-scope-release-secrets
Sep 16, 2026
Merged

fredericoo merged 3 commits into
mainfrom
gg-scope-release-secrets

Conversation

@graygilmore

@graygilmore graygilmore commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

The release workflows exposed release credentials more broadly than needed. VSCE_PAT, OVSX_PAT, and repo credentials were available to install/build steps even though only specific release steps need them.

This PR tightens that up:

  • Removes NPM_TOKEN from vscode-release.yml. That workflow only publishes to the VS Code Marketplace and Open VSX; npm publishing lives in release.yml and already runs over OIDC.
  • Moves VSCE_PAT and OVSX_PAT from workflow-level env: onto the vsce publish and ovsx publish steps in both workflows. vsce show hits the public gallery API and doesn't need the PAT.
  • Removes workflow-level GITHUB_TOKEN from both workflows.
  • Disables checkout credential persistence so install/build steps do not inherit authenticated git credentials.
  • Keeps GITHUB_TOKEN scoped to changesets/action in release.yml, then clears the .netrc credentials that action writes before the marketplace publish steps.
  • Adds explicit contents: read permissions to the manual VS Code release workflow.

Marketplace publishing authentication is unchanged; the required tokens are still available to the publish commands that need them.

Tophatting

There should be no functional changes. The next release.yml run on main that ships a VS Code extension version bump should still publish to both marketplaces. If either publish step fails with an auth error, the env didn't make it onto the step.

vscode-release.yml only publishes to the VS Code Marketplace and Open
VSX; npm publishing lives in release.yml and already runs over OIDC.
Nothing in this workflow reads NPM_TOKEN, so drop it.

Assisted-By: devx/d9810122-2b8f-4f8d-b51b-eb980219e4b6
VSCE_PAT and OVSX_PAT were set at the workflow level, so every step,
including pnpm install and the build, could read them. Only the vsce and
ovsx publish steps need them, so move the tokens onto those steps.

vsce show uses the public gallery API and does not need the PAT.

Assisted-By: devx/d9810122-2b8f-4f8d-b51b-eb980219e4b6
@graygilmore
graygilmore force-pushed the gg-scope-release-secrets branch from ab176cb to c05c2be Compare September 11, 2026 23:12
Assisted-By: devx/1fcb32d2-4780-44a8-8dc3-0c25314bc391
@fredericoo
fredericoo marked this pull request as ready for review September 16, 2026 10:40
@fredericoo
fredericoo requested a review from a team as a code owner September 16, 2026 10:40
@fredericoo
fredericoo merged commit 4826a64 into main Sep 16, 2026
8 checks passed
@fredericoo
fredericoo deleted the gg-scope-release-secrets branch September 16, 2026 17:16
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.

3 participants