From bf7d0d88f6eb63cc7095fe810e6471c8df447ea5 Mon Sep 17 00:00:00 2001 From: Richard Bliss Date: Wed, 19 Jul 2023 16:49:08 -0600 Subject: [PATCH] Add option to allow creating a release for local builds --- README.md | 1 + index.js | 3 ++- manifest.yml | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bc3da13..85c7fb8 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,7 @@ For more information about the parameters below, please see the [Sentry release | `skipSourceMaps` | - | If true, disable uploading source maps to Sentry. | `false` | | `deployPreviews` | - | If false, skip running the build plugin on preview deploys. | `true` | | `deleteSourceMaps` | SENTRY_DELETE_SOURCEMAPS | If true, delete source maps after uploading them to Sentry. May cause browser console errors if not used alongside your build tool's equivalent of webpack's [`hidden-source-map` option](https://webpack.js.org/configuration/devtool/). | `false` | +| `enableLocal` | SENTRY_LOCAL | If true, create a Sentry release for local builds. | `false` | ## `@sentry/netlify-build-plugin` vs. `@netlify/sentry` diff --git a/index.js b/index.js index 68f2475..454c033 100644 --- a/index.js +++ b/index.js @@ -39,8 +39,9 @@ module.exports = { const sourceMapPath = inputs.sourceMapPath || PUBLISH_DIR; const sourceMapUrlPrefix = inputs.sourceMapUrlPrefix || DEFAULT_SOURCE_MAP_URL_PREFIX; const shouldDeleteMaps = process.env.SENTRY_DELETE_SOURCEMAPS || inputs.deleteSourceMaps; + const enableLocal = process.env.SENTRY_LOCAL || inputs.enableLocal; - if (RUNNING_IN_NETLIFY) { + if (RUNNING_IN_NETLIFY || enableLocal) { if (IS_PREVIEW && !inputs.deployPreviews) { console.log('Skipping Sentry release creation - Deploy Preview'); return; diff --git a/manifest.yml b/manifest.yml index 35ad926..e85ce42 100644 --- a/manifest.yml +++ b/manifest.yml @@ -28,3 +28,6 @@ inputs: - name: deleteSourceMaps description: If true, delete source maps after uploading them to Sentry. default: False + - name: enableLocal + description: Create a Sentry release for local builds. + default: False \ No newline at end of file