Repository navigation
chore(ci): publish a tarball built in ci so the npm token job runs no dependency code - #1195
Conversation
… 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.
|
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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>
| retention-days: 1 | |
| retention-days: 30 |
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
resendversion. 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.
Written for commit 3dc8978. Summary will update on new commits.