Skip to content

ci: adopt Changesets with a gated production release - #16

Merged
Bre77 merged 1 commit into
mainfrom
fm/o10-e102-s6-node-lib-changesets
Aug 6, 2026
Merged

ci: adopt Changesets with a gated production release#16
Bre77 merged 1 commit into
mainfrom
fm/o10-e102-s6-node-lib-changesets

Conversation

@Bre77

@Bre77 Bre77 commented Aug 6, 2026

Copy link
Copy Markdown
Member

What

  • Adopt Changesets for versioning/publishing instead of hand-cut GitHub Releases: .changeset/config.json (access: public, baseBranch: main), plus pnpm changeset / pnpm run ci:publish scripts.
  • Extract the CI suite (typecheck, lint, test, publint, npm pack --dry-run) into .github/workflows/reusable-ci.yml so ci.yml and publish.yml run the identical checks.
  • Rework publish.yml: trigger on push to main instead of release: published. A validate job runs the reusable CI suite; release (needs: validate) then runs changesets/action@v1, which opens/updates a version PR or, once that PR is merged, runs changeset publish. Gating release on validate in the same run means the exact SHA about to publish has passed full CI - not a possibly-stale separate run.
  • Add a production GitHub environment (configured via the API, required reviewer: repo owner) to release, so merging the version PR only prepares a release; publishing still requires approving the environment deployment.
  • Add publishConfig.access/provenance to package.json to match the pattern used elsewhere in the org (e.g. typescript-teslemetry's packages).

Registry-side setting to verify

npm trusted publishing (OIDC) is configured per-package on npmjs.com. This PR keeps the same repo + workflow filename (.github/workflows/publish.yml), so the existing trusted publisher entry for tesla-fleet-api should still match, but please confirm on npmjs.com (package Settings → Trusted Publisher) that it points at Teslemetry/node-tesla-fleet-api / .github/workflows/publish.yml, and consider restricting it to the production environment now that one exists.

Merging a version PR now only prepares a release; publishing to npm
requires approving the `production` GitHub environment, which re-runs
the full CI suite (lint/typecheck/test/publint/pack) against the exact
SHA being published before `changeset publish` runs. Replaces the
hand-cut GitHub Release trigger with push-to-main + Changesets, reusing
the existing npm OIDC trusted publishing setup.
@Bre77 Bre77 added the fm Opened by a Firstmate crewmate label Aug 6, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1c24f79e49

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

name: Release
needs: validate
runs-on: ubuntu-latest
environment: production

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restrict production approval to the publish path

When a normal PR carrying a changeset is merged, this job must open or update the Version Packages PR, but GitHub applies required-reviewer environment protection before starting any step in the job. Putting environment: production here therefore makes PR creation and updates wait for production approval as well; approval cannot be limited to the changeset publish branch inside changesets/action, so routine merges no longer drive the advertised Changesets flow automatically. Split PR maintenance from the environment-protected publishing path.

AGENTS.md reference: AGENTS.md:L15-L15

Useful? React with 👍 / 👎.

@Bre77
Bre77 merged commit 77783ae into main Aug 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fm Opened by a Firstmate crewmate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant