Skip to content

chore(ci): publish a tarball built in ci so the npm token job runs no dependency code - #1195

Merged
felipefreitag merged 1 commit into
canaryfrom
chore/split-release-job
Nov 12, 2026
Merged

felipefreitag merged 1 commit into
canaryfrom
chore/split-release-job

Conversation

@felipefreitag

@felipefreitag felipefreitag commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

The npm publish token no longer shares a job with dependency code. Before, the publish job installed every dependency and rebuilt the SDK while it held the token, so a compromised dependency could take the token and publish any resend version. Now the ci job packs the tarball it already built and tested, and the publish job only checks that tarball and uploads it. This follows what react-email shipped this week.

Not covered. A compromised build tool can still change the tarball it builds.

How to test. The release workflow only runs on a v* tag, so the next release is the first real run. A re-run of a failed publish job skips a version that is already on npm.


Summary by cubic

The release workflow now publishes a tarball built in CI so the npm publish token never runs dependency code. Previously the publish job installed every dependency and rebuilt the SDK while holding the token; now the ci job packs the tarball it already built and tested, and the publish job only verifies and uploads it.

  • The publish job no longer checks out the repo or installs dependencies.
  • A re-run of a failed publish skips a version already on npm.
  • A compromised build tool can still change the tarball it builds.

Written for commit 3dc8978. Summary will update on new commits.

View guided diff

… dependency code

The ci job packs the tarball after the build. The publish job only checks
that the tarball holds resend at the tagged version and runs npm publish on
it with --ignore-scripts. It skips the publish when the version is already
on npm, so a re-run recovers.
@felipefreitag
felipefreitag requested a review from a team as a code owner November 12, 2026 19:54
@cubic-dev-ai

cubic-dev-ai Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Running ultrareview automatically — this PR appears to change infrastructure or deployment configuration, where a missed bug can break builds, releases, or production environments, so a deeper multi-pass review is worth running. I'll post findings when complete.

@cubic-dev-ai cubic-dev-ai Bot 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.

Ultrareview ran automatically — this PR appears to change infrastructure or deployment configuration, where a missed bug can break builds, releases, or production environments, so a deeper multi-pass review is worth running.

1 issue found across 1 file

Confidence score: 4/5

  • In .github/workflows/release.yml, the artifact expires after one day, so a delayed publish-only rerun may not be able to download it. Keep it for a longer recovery window, such as 30 days.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/release.yml">

<violation number="1" location=".github/workflows/release.yml:92">
P2: This artifact expires after one day, so a delayed publish-only rerun cannot download it. Keep it for a longer release-recovery window, such as 30 days.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

name: npm-tarball
path: npm-tarball
if-no-files-found: error
retention-days: 1

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.

P2: This artifact expires after one day, so a delayed publish-only rerun cannot download it. Keep it for a longer release-recovery window, such as 30 days.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .github/workflows/release.yml, line 92:

<comment>This artifact expires after one day, so a delayed publish-only rerun cannot download it. Keep it for a longer release-recovery window, such as 30 days.</comment>

<file context>
@@ -79,6 +79,17 @@ jobs:
+          name: npm-tarball
+          path: npm-tarball
+          if-no-files-found: error
+          retention-days: 1
   publish-npm:
     needs: ci
</file context>
Suggested change
retention-days: 1
retention-days: 30

@felipefreitag
felipefreitag merged commit 805b2ec into canary Nov 12, 2026
12 checks passed
@felipefreitag
felipefreitag deleted the chore/split-release-job branch November 12, 2026 20:06
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.

2 participants