ota-manager 1.0.15 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/ota-build.cjs +19 -4
  2. package/package.json +1 -1
package/lib/ota-build.cjs CHANGED
@@ -282,15 +282,28 @@ async function buildIos() {
282
282
  try {
283
283
  execSync('git add .', { stdio: 'ignore' });
284
284
  const status = execSync('git status --porcelain').toString();
285
+
286
+ let remoteName = 'origin';
287
+ try {
288
+ const remotes = execSync('git remote').toString().trim().split(/\s+/);
289
+ if (!remotes.includes('origin')) {
290
+ if (remotes.includes('github')) {
291
+ remoteName = 'github';
292
+ } else if (remotes.length > 0 && remotes[0]) {
293
+ remoteName = remotes[0];
294
+ }
295
+ }
296
+ } catch (err) {}
297
+
285
298
  if (status) {
286
- console.log('📤 Pushing changes to GitHub...');
299
+ console.log(`📤 Pushing changes to ${remoteName}...`);
287
300
  execSync('git commit -m "chore: automated build sync"', { stdio: 'ignore' });
288
- execSync(`git push origin ${branch}`, { stdio: 'ignore' });
301
+ execSync(`git push ${remoteName} ${branch}`, { stdio: 'ignore' });
289
302
  console.log('✅ Changes pushed!');
290
303
  await sleep(2000);
291
304
  } else {
292
- console.log('✅ No local file changes. Ensuring active branch ref is pushed to remote...');
293
- execSync(`git push origin ${branch}`, { stdio: 'ignore' });
305
+ console.log(`✅ No local file changes. Ensuring active branch ref is pushed to remote on ${remoteName}...`);
306
+ execSync(`git push ${remoteName} ${branch}`, { stdio: 'ignore' });
294
307
  }
295
308
  } catch (e) {
296
309
  console.log('⚠️ Git push skipped or branch already up to date on remote.');
@@ -315,6 +328,8 @@ async function buildIos() {
315
328
  payload.inputs.app_store_connect_api_key_base64 = getBase64OrFileContent(apiKeyVal);
316
329
  payload.inputs.app_store_connect_api_key_id = process.env.APP_STORE_CONNECT_API_KEY_ID || '';
317
330
  payload.inputs.app_store_connect_api_issuer = process.env.APP_STORE_CONNECT_API_ISSUER || '';
331
+ payload.inputs.apple_p12_password = process.env.APPLE_P12_PASSWORD || '';
332
+ payload.inputs.apple_keychain_password = process.env.APPLE_KEYCHAIN_PASSWORD || '';
318
333
  }
319
334
  await githubApi(`/repos/${REPO}/actions/workflows/${activeWorkflowId}/dispatches`, 'POST', payload);
320
335
  console.log('✅ Trigger Success! Waiting for run to start...');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ota-manager",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "Multi-provider OTA update manager for Astro and static web projects.",
5
5
  "type": "module",
6
6
  "main": "index.js",