Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/transports-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ jobs:
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
run: |
# Trim whitespace from secrets
export R2_ENDPOINT="$(echo "$R2_ENDPOINT" | tr -d '[:space:]')"
export R2_ACCESS_KEY_ID="$(echo "$R2_ACCESS_KEY_ID" | tr -d '[:space:]')"
export R2_SECRET_ACCESS_KEY="$(echo "$R2_SECRET_ACCESS_KEY" | tr -d '[:space:]')"
# Strip 'transports/' prefix and add 'v' prefix for upload script
VERSION_ONLY="${{ steps.manage_versions.outputs.transport_version }}"
VERSION_ONLY=${VERSION_ONLY#transports/v}
Expand Down
26 changes: 19 additions & 7 deletions ci/scripts/upload-builds.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,27 @@ async function uploadWithRetry(filePath, s3Key, maxRetries = 3) {
}
}

// Exit if any required environment variables are missing
// Debug and validate environment variables
console.log('🔍 Environment variables debug:');
const requiredEnvVars = ['R2_ENDPOINT', 'R2_ACCESS_KEY_ID', 'R2_SECRET_ACCESS_KEY'];
const missingEnvVars = requiredEnvVars.filter(varName => !process.env[varName]);

if (missingEnvVars.length > 0) {
console.error(`❌ Missing required environment variables: ${missingEnvVars.join(', ')}`);
console.error('Please set all required environment variables before running this script.');
process.exit(1);
}
requiredEnvVars.forEach(varName => {
const value = process.env[varName];
if (!value) {
console.log(`❌ ${varName}: Missing`);
process.exit(1);
} else {
// Show first/last few chars to verify without exposing secrets
const masked = value.length > 4
? `${value.substring(0, 2)}...${value.substring(value.length - 2)}`
: `${value.substring(0, 1)}...`;
console.log(`✅ ${varName}: Set (${value.length} chars) ${masked}`);

// Check for common issues
if (value.includes('\n')) console.log(`⚠️ ${varName}: Contains newlines`);
if (value.startsWith(' ') || value.endsWith(' ')) console.log(`⚠️ ${varName}: Contains leading/trailing spaces`);
}
});

// Uploadig new folder
console.log("uploading new release...");
Expand Down