Skip to content

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

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
Contributor

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-yaml → release.yml
  • Open VSX — trusted publisher for redhat/vscode-yaml → 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

Signed-off-by: Fred Bricon <fbricon@gmail.com>
@fbricon
fbricon requested a review from datho7561 as a code owner November 17, 2026 12:10
@datho7561 datho7561 added this to the 2.1.0 milestone Nov 17, 2026
@datho7561

Copy link
Copy Markdown
Contributor

Should be run on prerelease build and we can address any issues it causes if they come up.

@datho7561 datho7561 added enhancement build Caused by or related to an npm script, GitHub Action or other build or CI/CD component. labels Nov 17, 2026
@datho7561
datho7561 merged commit 8582b6d into main Nov 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Caused by or related to an npm script, GitHub Action or other build or CI/CD component. enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants