Skip to content

fix: generate deploy keys to per-call temp path with cleanup#258

Merged
sagar1312 merged 2 commits into
masterfrom
sagar1312-fix-deploy-key-temp-path
May 29, 2026
Merged

fix: generate deploy keys to per-call temp path with cleanup#258
sagar1312 merged 2 commits into
masterfrom
sagar1312-fix-deploy-key-temp-path

Conversation

@sagar1312
Copy link
Copy Markdown
Member

@sagar1312 sagar1312 commented May 29, 2026

Summary

  • generateDeployKey now writes the RSA private key into a unique directory created via fs.promises.mkdtemp(os.tmpdir() + '/sd-deploykey-') instead of the predictable in-module ${__dirname}/keys_rsa path.
  • The keygen invocation is wrapped in try/finally so the temp directory is removed regardless of outcome.

Test plan

  • Existing unit tests for generateDeployKey continue to pass.
  • npm run lint and npm test are green.

The deploy-key generator wrote the RSA private key to a fixed path
inside the package install directory with no guaranteed cleanup if
the subsequent GitHub API call failed. Generate each key into a
unique directory under os.tmpdir() and remove the directory in a
try/finally regardless of outcome.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sagar1312 sagar1312 merged commit 97d2c85 into master May 29, 2026
2 checks passed
@sagar1312 sagar1312 deleted the sagar1312-fix-deploy-key-temp-path branch May 29, 2026 16:39
@sd-buildbot
Copy link
Copy Markdown

🎉 This PR is included in version 14.6.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants