ci: publish npm packages from GitHub Actions - #31
Merged
Conversation
The lock is from the 0.1.1 version PR. git and npm already match, so the first CI publish run should no-op instead of re-auditing a spent lock.
Run tegami ci on main with npm OIDC trusted publishing so releases no longer depend on a laptop npm login.
Split preview generation from commenting so untrusted PR code never gets a writable token.
Describe tegami ci on main, trusted publishing, and keep laptop publish as emergency-only. This public repo expects npm provenance.
aryasaatvik
marked this pull request as ready for review
August 25, 2026 23:02
Greptile SummaryThe PR moves npm package releases to a GitHub Actions and OIDC trusted-publishing flow, with merging the generated Version Packages PR remaining the human gate.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| .github/workflows/publish.yml | Adds a serialized main-branch workflow that versions and publishes packages with GitHub OIDC permissions. |
| .github/workflows/tegami-pr.yml | Generates the Tegami release preview in the unprivileged pull-request workflow and uploads it as a single artifact. |
| .github/workflows/tegami-pr-comment.yml | Downloads the preview into an isolated temporary directory before the default-branch command posts it with pull-request write permission, resolving the previously reported workspace-overwrite path. |
| scripts/tegami.mts | Enables GitHub trusted publishing for publish.yml and allows Tegami to reuse an existing Version Packages PR. |
| docs/releases.md | Documents the automated versioning, OIDC publishing, verification, retry, and emergency local-release procedures. |
Sequence Diagram
sequenceDiagram
participant Contributor
participant Main as main branch
participant Publish as publish.yml
participant Tegami
participant VersionPR as Version Packages PR
participant npm
Contributor->>Main: Merge changelog
Main->>Publish: Trigger push workflow
Publish->>Tegami: tegami ci
Tegami->>VersionPR: Open or update version PR
Contributor->>VersionPR: Review and merge
VersionPR->>Main: Version changes and publish lock
Main->>Publish: Trigger push workflow
Publish->>Tegami: tegami ci
Tegami->>npm: Publish via OIDC with provenance
Reviews (2): Last reviewed commit: "ci: isolate Tegami preview artifact from..." | Re-trigger Greptile
…ile) Download the untrusted preview into RUNNER_TEMP so a fork cannot overwrite default-branch package.json before tegami pr comment runs with write tokens.
Contributor
Author
|
@greptile review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Public integration packages publish from GitHub Actions via
tegami ciand npmOIDC trusted publishing. Merging the Version Packages PR is the human gate.
This public repo should get npm provenance attestations on the first CI publish.
Flow
Do not rename
publish.yml. npm pins that filename on@samva/better-authand@samva/email-sdk.PR changelog previews use a split workflow:
tegami-pr.yml(read, artifact)then
tegami-pr-comment.yml(comment).The leftover
.tegami/publish-lock.yamlfrom the 0.1.1 version PR is removed.git and npm already match
0.1.1, so the firstpublish.ymlrun should no-op.Validation
bun run tegami --help—ci,pr preview,pr comment, andnpm pretrustare registeredbun run tegami check-publish— exits 1 (nothing pending)bun run format:checkFollow-up
After merge, set GitHub Actions trusted publisher
AryaLabsHQ/samva-integrations/publish.yml(no environment) on both npmpackages. First real version bump waits on a changelog. Laptop
bun run releasestays emergency-only until that publish succeeds.