Skip to content

Commit 0c98e59

Browse files
committed
PR post-review fixes
1 parent 0f9e023 commit 0c98e59

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

packages/core/scripts/eas/build-on-complete.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,7 @@ async function main() {
4545
await runHook('on-complete', () => hooks.captureEASBuildComplete(options));
4646
}
4747

48-
main();
48+
main().catch(error => {
49+
console.error('[Sentry] Unexpected error in eas-build-on-complete hook:', error);
50+
process.exit(1);
51+
});

packages/core/scripts/eas/build-on-error.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,7 @@ async function main() {
3535
await runHook('on-error', () => hooks.captureEASBuildError(options));
3636
}
3737

38-
main();
38+
main().catch(error => {
39+
console.error('[Sentry] Unexpected error in eas-build-on-error hook:', error);
40+
process.exit(1);
41+
});

packages/core/scripts/eas/build-on-success.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,7 @@ async function main() {
3737
await runHook('on-success', () => hooks.captureEASBuildSuccess(options));
3838
}
3939

40-
main();
40+
main().catch(error => {
41+
console.error('[Sentry] Unexpected error in eas-build-on-success hook:', error);
42+
process.exit(1);
43+
});

packages/core/scripts/eas/utils.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,12 @@ function parseBaseOptions() {
8787
// Parse additional tags if provided
8888
if (process.env.SENTRY_EAS_BUILD_TAGS) {
8989
try {
90-
options.tags = JSON.parse(process.env.SENTRY_EAS_BUILD_TAGS);
90+
const parsed = JSON.parse(process.env.SENTRY_EAS_BUILD_TAGS);
91+
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
92+
options.tags = parsed;
93+
} else {
94+
console.warn('[Sentry] SENTRY_EAS_BUILD_TAGS must be a JSON object (e.g., {"key":"value"}). Ignoring.');
95+
}
9196
} catch (_e) {
9297
console.warn('[Sentry] Could not parse SENTRY_EAS_BUILD_TAGS as JSON. Ignoring.');
9398
}

0 commit comments

Comments
 (0)