Skip to content

fix(release): fail fast with a clear error when VSCE_PAT/OVSX_PAT are unset - #50

Merged
bhouston merged 2 commits into
mainfrom
fix/49-vsce-publish-skip-when-pat-missing
Sep 18, 2026
Merged

bhouston merged 2 commits into
mainfrom
fix/49-vsce-publish-skip-when-pat-missing

Conversation

@bhouston

@bhouston bhouston commented Sep 18, 2026 •

Copy link
Copy Markdown
Owner

Closes #49

What changed

scripts/release-vscode-extension.mjs's publish() now throws an explicit error naming which of VSCE_PAT/OVSX_PAT is missing and pointing at RELEASING.md, instead of calling vsce publish --pat '' and letting Azure DevOps reject it with a cryptic TF400813 error.

Publishing the extension is still required, not optional — this only replaces the confusing failure with a clear one; it does not skip the publish step.

Why

Run https://github.com/bhouston/hdrify/actions/runs/35386664895 failed with:

##[error]The Personal Access Token verification has failed. Additional information:
TF400813: The user 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' is not authorized to access this resource.

That message doesn't say what's actually wrong (the VSCE_PAT/OVSX_PAT repo secrets from RELEASING.md step 6 aren't configured yet). This makes the failure self-explanatory so the next person doesn't have to dig through vsce/Azure DevOps internals to find the real cause.

Test plan

  • pnpm build
  • pnpm tsc
  • pnpm lint
  • pnpm test --coverage (thresholds met: 89.22% stmts / 72.29% branches / 93.92% funcs / 89.78% lines)
  • pnpm release:check — added a test asserting publish() throws a clear error naming the missing secret(s) when VSCE_PAT/OVSX_PAT are unset
  • pnpm size
  • pnpm audit --audit-level=high reviewed — findings are pre-existing/unrelated (same as noted in the failed run's CI annotations)

…re unset

vsce publish was called with --pat '' because the VSCE_PAT/OVSX_PAT
secrets aren't configured yet, which made Azure DevOps reject the
request and aborted the whole semantic-release run before it could
create the GitHub Release for the already-published npm packages.

Skip the marketplace/registry publish with a warning when either PAT
is missing instead of throwing, so this optional integration can't
block the rest of the release.

Closes #49
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Publishing to the VS Code Marketplace/Open VSX still requires
VSCE_PAT/OVSX_PAT — this is not optional. Replace the confusing
`vsce publish --pat ''` / TF400813 Azure DevOps error with an explicit
error naming the missing secret(s) and pointing at RELEASING.md.
@bhouston bhouston changed the title fix(release): skip VS Code extension publish when VSCE_PAT/OVSX_PAT are unset fix(release): fail fast with a clear error when VSCE_PAT/OVSX_PAT are unset Sep 18, 2026
@bhouston
bhouston merged commit 80852e4 into main Sep 18, 2026
4 checks passed
@bhouston
bhouston deleted the fix/49-vsce-publish-skip-when-pat-missing branch September 18, 2026 19:52
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.

Release job fails when VSCE_PAT/OVSX_PAT secrets are not configured

2 participants