Skip to content

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

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-xml → release.yml
  • Open VSX — trusted publisher for redhat/vscode-xml → 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 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Chores
    • Updated the release publishing process for the Visual Studio Marketplace and Open VSX. Existing publishing conditions and duplicate-package handling remain unchanged.

The release workflow adds job permissions and replaces token-based authentication with OIDC and trusted publishing for VS Code Marketplace and OpenVSX.

Changes: Release publishing authentication

Layer / File(s) Summary
Configure release publishing authentication
.github/workflows/release.yml
The release job adds contents: read and id-token: write. Publishing to VS Code Marketplace uses --oidc, and publishing to OpenVSX uses --trusted-publishing. Package paths, conditions, and --skip-duplicate behavior remain unchanged.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: rgrunber

Merge Risk: Minimal · up to 337fe

The release workflow now publishes to the VS Code Marketplace and Open VSX with short-lived OIDC credentials instead of stored tokens. The visible workflow configuration and the CLI versions it installs support this. The remaining dependency is the registry-side trust setup, which the author reports is done. No merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "ci: publish to extension registries with trusted publishing" matches the main change. The changeset switches release.yml from registry token secrets to OIDC trusted publishing for the VS Co…
Description check Passed The description explains why the change is made (long-lived, publisher-wide tokens and manual rotation) and what changed (vsce/ovsx trusted publishing, id-token: write, removed token secrets). It also…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "ci: publish to extension registries with trusted publishing" matches the main change. The changeset switches release.yml from registry token secrets to OIDC trusted publishing for the VS Code Marketplace (vsce publish --oidc) and Open VSX (ovsx publish --trusted-publishing), and grants id-token: write.

Full details: Description check

Explanation

The description explains why the change is made (long-lived, publisher-wide tokens and manual rotation) and what changed (vsce/ovsx trusted publishing, id-token: write, removed token secrets). It also covers registry configuration and post-merge token revocation. It relates directly to the changeset.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a4e0ec7e-3f14-4504-90af-e8708a75bc8b
Commits

Reviewing files that changed from the base of the PR and between e3767c5 and 337fec3.

Files selected for processing: 1

  • .github/workflows/release.yml

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@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.

Looks good. This is run every day for prereleases, so we should be able to detect and address any problems that come up then.

There's a Jenkins script in this repo that still publishes using the token, but I think it's unused and can probably be removed.

@datho7561 datho7561 added this to the 0.30.0 milestone Nov 17, 2026
@datho7561 datho7561 added enhancement New feature or request build labels Nov 17, 2026
@datho7561
datho7561 merged commit aa31b72 into main Nov 17, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants