Skip to content

Commit 04371a5

Browse files
committed
ref: Dont run build-awslambda-layer locally
1 parent 226b96d commit 04371a5

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

packages/gatsby/test/gatsby-browser.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ describe('onClientEntry', () => {
4646
environment: process.env.NODE_ENV,
4747
integrations: [],
4848
release: (global as any).__SENTRY_RELEASE__,
49+
autoSessionTracking: true,
4950
_metadata: {
5051
sdk: {
5152
name: 'sentry.javascript.gatsby',

packages/serverless/scripts/build-awslambda-layer.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
const path = require('path');
23
const process = require('process');
34
const fs = require('fs');
@@ -9,6 +10,11 @@ const readPkg = require('read-pkg');
910

1011
const serverlessPackage = require('../package.json');
1112

13+
if (!process.env.GITHUB_ACTIONS) {
14+
console.log(`Skipping build-awslambda-layer script in local environment.`);
15+
process.exit(0);
16+
}
17+
1218
// AWS Lambda layer are being uploaded as zip archive, whose content is then being unpacked to the /opt
1319
// directory in the lambda environment.
1420
//
@@ -46,12 +52,11 @@ async function collectPackages(cwd, packages = {}) {
4652
// Internal deps aka local node_modules folder of each package is handled differently.
4753
const searchPath = path.resolve(cwd, '..');
4854
const depPath = fs.realpathSync(
49-
await findUp(path.join('node_modules', dep),
50-
{ type: 'directory', cwd: searchPath })
55+
await findUp(path.join('node_modules', dep), { type: 'directory', cwd: searchPath }),
5156
);
5257
if (packages[dep]) {
5358
if (packages[dep].cwd != depPath) {
54-
throw new Error(`${packageJson.name}'s dependenciy ${dep} maps to both ${packages[dep].cwd} and ${depPath}`);
59+
throw new Error(`${packageJson.name}'s dependency ${dep} maps to both ${packages[dep].cwd} and ${depPath}`);
5560
}
5661
return;
5762
}
@@ -146,7 +151,7 @@ async function main() {
146151
} catch (error) {
147152
// The child process timed out or had non-zero exit code.
148153
// The error contains the entire result from `childProcess.spawnSync`.
149-
console.log(error); // eslint-disable-line no-console
154+
console.log(error);
150155
}
151156
}
152157

@@ -155,7 +160,7 @@ main().then(
155160
process.exit(0);
156161
},
157162
err => {
158-
console.error(err); // eslint-disable-line no-console
163+
console.error(err);
159164
process.exit(-1);
160165
},
161166
);

0 commit comments

Comments
 (0)