Skip to content

ci: publish to extension registries with trusted publishing - #4575

Merged
datho7561 merged 1 commit into
mainfrom
trusted-publishing
Nov 17, 2026
Merged

datho7561 merged 1 commit into
mainfrom
trusted-publishing

Conversation

@fbricon

@fbricon fbricon commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Why

Publishing to the VS Code Marketplace and Open VSX relies on access tokens
stored as repository secrets. They are long-lived bearer credentials, scoped to
the whole publisher rather than to a single extension, and readable by every job
in the repo: a compromised job or a leaked secret grants write access to every
extension under redhat until the token is revoked. They also have to be
rotated by hand on a schedule, and because the same token is shared across many
repos, every rotation means updating all of them.

Trusted Publishing replaces them with an OIDC token minted for a single workflow
run and validated by each registry against this repository and workflow file.
Nothing long-lived is stored, a leaked log or a compromised job yields no
reusable credential, and there is no rotation left to do.

What changed

  • VS Code Marketplace: vsce publish --oidc
  • Open VSX: ovsx publish --trusted-publishing
  • id-token: write granted to the publishing job(s) in release.yml
  • registry token secrets and their env: blocks removed

Publishing runs on a nightly schedule (pre-release) and on manual dispatch (stable), in release.yml.

Registry configuration

Already in place, nothing for reviewers to do:

  • VS Code Marketplace — trusted publisher for redhat-developer/vscode-java → release.yml
  • Open VSX — trusted publisher for redhat/java → release.yml

Trust is bound to the repository and workflow file (the OIDC workflow_ref claim),
not to a branch, so it applies as soon as this merges.

After merge

This repo's registry tokens (OVSX_MARKETPLACE_TOKEN, VSCODE_MARKETPLACE_TOKEN) are no longer
read by any workflow. They can be revoked once a trusted publish has succeeded —
keeping them until then is a safe fallback.

Publishing to the VS Code Marketplace and Open VSX relies on access
tokens stored as repository secrets. They are long-lived bearer
credentials, scoped to the whole publisher rather than to a single
extension, and readable by every job in the repo: a compromised job or a
leaked secret grants write access to every extension under `redhat`
until the token is revoked. They also have to be rotated by hand on a
schedule, and because the same token is shared across many repos, every
rotation means updating all of them -- while a missed rotation breaks
releases until someone notices.

Trusted Publishing replaces them with an OIDC token minted for a single
workflow run and validated by each registry against this repository and
workflow file. Nothing long-lived is stored, a leaked log or a
compromised job yields no reusable credential, and there is no rotation
left to do.

Publishing happens on a nightly schedule (pre-release) and on manual
dispatch (stable). That workflow therefore remains the single publishing
path and is the one registered as trusted publisher on both registries.

- VS Code Marketplace: `vsce publish --oidc`
- Open VSX: `ovsx publish --trusted-publishing`
- grant `id-token: write` to the publishing job
- bump Node.js to 22, required by current @vscode/vsce and ovsx

Signed-off-by: Fred Bricon <fbricon@gmail.com>

@datho7561 datho7561 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be the right setup. I think we should go ahead and merge this; we'll be able to test it through prerelease builds without having to go through a release cycle. If there's issues, we can get them ironed out before the end of month release.

@datho7561 datho7561 added this to the End of November 2026 milestone Nov 17, 2026
@datho7561
datho7561 merged commit 4a40253 into main Nov 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants