Skip to content

[remote-ui] Publish to npm via OIDC trusted publishing - #745

Closed
robin-drexler wants to merge 1 commit into
remote-uifrom
rd/remote-ui-oidc
Closed

robin-drexler wants to merge 1 commit into
remote-uifrom
rd/remote-ui-oidc

Conversation

@robin-drexler

Copy link
Copy Markdown
Member

Follow-up to #744. The remote-ui branch still publishes with NPM_TOKEN, and it needs to move to OIDC trusted publishing (like main already did) before we merge #741.

  • changesets.yml gets id-token: write and NPM_TOKEN: ''. With an empty token, changesets/action skips writing an .npmrc and npm does the OIDC exchange on its own. Provenance is on, same as main.
  • Pinned changesets/action to the v1.9.0 SHA main uses. v1 points to the exact same commit today, so no behavior change, but I'd rather not hand id-token: write to a moving tag.
  • Locked GITHUB_TOKEN down to contents: read. Pushes and the release PR already go through SHOPIFY_GH_ACCESS_TOKEN.
  • Added repository to every @remote-ui/* package.json. None of them had one, and npm rejects provenance publishes when repository.url doesn't match the repo the workflow ran in.

Heads up: every package that gets published also needs a trusted publisher on npm pointing at changesets.yml. AFAIK only @remote-ui/core and @remote-ui/react have been requested so far, but #741 also publishes dom, htm, testing, traversal and vue. If those aren't set up before #741 merges, we'll end up with a partial release.

🎩

  • green CI
  • changesets.yml only runs on push to remote-ui, so this can't really be exercised in the PR. Merging this just refreshes Version Packages #741. The first real OIDC publish happens when Version Packages #741 merges.

Gives the Changesets job id-token: write and an empty NPM_TOKEN so
changesets/action skips writing an .npmrc and npm does the OIDC token
exchange instead. Provenance is enabled to match main.

Pins changesets/action to the v1.9.0 SHA main uses (v1 points to the
same commit today) since the job can now mint OIDC tokens, and locks
GITHUB_TOKEN down to contents: read. Pushes and the release PR already
go through SHOPIFY_GH_ACCESS_TOKEN.

Adds a repository field to every @remote-ui/* package. npm rejects
provenance publishes when repository.url doesn't match the source repo.
@github-actions

Copy link
Copy Markdown
Contributor

We detected some changes in packages/*/package.json or packages/*/src, and there are no updates in the .changeset directory.
If the changes are user-facing and should cause a version bump, run yarn changeset to track your changes and include them in the next release CHANGELOG.
If you are making simple updates to repo configuration, examples, or documentation, you do not need to add a changeset.

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.

1 participant