mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-20 16:05:18 +00:00
fix: skip R2 upload when credentials not available
This commit is contained in:
parent
dc53a3fde5
commit
1f5ddc1761
1 changed files with 11 additions and 0 deletions
|
|
@ -3,6 +3,10 @@ import { $ } from "execa";
|
||||||
import type { ReleaseOpts } from "./main";
|
import type { ReleaseOpts } from "./main";
|
||||||
import { assertDirExists, PREFIX, uploadDirToReleases } from "./utils";
|
import { assertDirExists, PREFIX, uploadDirToReleases } from "./utils";
|
||||||
|
|
||||||
|
function hasR2Credentials(): boolean {
|
||||||
|
return !!(process.env.R2_RELEASES_ACCESS_KEY_ID && process.env.R2_RELEASES_SECRET_ACCESS_KEY);
|
||||||
|
}
|
||||||
|
|
||||||
export async function buildJsArtifacts(opts: ReleaseOpts) {
|
export async function buildJsArtifacts(opts: ReleaseOpts) {
|
||||||
await buildAndUploadTypescriptSdk(opts);
|
await buildAndUploadTypescriptSdk(opts);
|
||||||
}
|
}
|
||||||
|
|
@ -30,6 +34,13 @@ async function buildAndUploadTypescriptSdk(opts: ReleaseOpts) {
|
||||||
|
|
||||||
await assertDirExists(sdkDistPath);
|
await assertDirExists(sdkDistPath);
|
||||||
|
|
||||||
|
// Check if we have R2 credentials before attempting upload
|
||||||
|
if (!hasR2Credentials()) {
|
||||||
|
console.log(`⚠️ Skipping upload: R2_RELEASES_ACCESS_KEY_ID and R2_RELEASES_SECRET_ACCESS_KEY not set`);
|
||||||
|
console.log(` Set these environment variables or configure GitHub secrets to enable uploads`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Upload to commit directory
|
// Upload to commit directory
|
||||||
console.log(`Uploading TypeScript SDK to ${PREFIX}/${opts.commit}/typescript/`);
|
console.log(`Uploading TypeScript SDK to ${PREFIX}/${opts.commit}/typescript/`);
|
||||||
await uploadDirToReleases(sdkDistPath, `${PREFIX}/${opts.commit}/typescript/`);
|
await uploadDirToReleases(sdkDistPath, `${PREFIX}/${opts.commit}/typescript/`);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue