diff --git a/.github/workflows/sentry.yml b/.github/workflows/sentry.yml index 23c23c9f7..0190f014b 100644 --- a/.github/workflows/sentry.yml +++ b/.github/workflows/sentry.yml @@ -29,15 +29,3 @@ jobs: SENTRY_ORG: ${{ secrets.SENTRY_ORG }} SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} run: npm run build --if-present - - - name: Create a Sentry.io release - uses: getsentry/action-release@v1 - env: - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - SENTRY_ORG: ${{ secrets.SENTRY_ORG }} - SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} - with: - tagName: ${{ github.event.inputs.commit_hash }} - releaseNamePrefix: insights-chrome - environment: master - sourcemaps: 'dist/sourcemaps' diff --git a/config/webpack.plugins.js b/config/webpack.plugins.js index ce88bbed0..c933db0a4 100644 --- a/config/webpack.plugins.js +++ b/config/webpack.plugins.js @@ -90,21 +90,16 @@ const plugins = (dev = false, beta = false, restricted = false) => { }), ...(dev ? [new ReactRefreshWebpackPlugin()] : []), // Put the Sentry Webpack plugin after all other plugins - ...(!dev && process.env.SENTRY_AUTH_TOKEN && process.env.SENTRY_ORG && process.env.SENTRY_PROJECT - ? [ - sentryWebpackPlugin({ - authToken: process.env.SENTRY_AUTH_TOKEN, - org: process.env.SENTRY_ORG, - project: process.env.SENTRY_PROJECT, - _experiments: { - moduleMetadata: ({ release }) => ({ - authToken: process.env.SENTRY_AUTH_TOKEN, - release, - }), - }, - }), - ] - : []), + // When authToken is defined, we build source maps, if not we upload debugIds + sentryWebpackPlugin({ + org: 'red-hat-it', + project: 'cpin-001-insights', + ...(process.env.SENTRY_AUTH_TOKEN && !dev ? { authToken: process.env.SENTRY_AUTH_TOKEN } : {}), + moduleMetadata: ({ release }) => ({ + ...(process.env.SENTRY_AUTH_TOKEN && !dev ? { authToken: process.env.SENTRY_AUTH_TOKEN } : {}), + release, + }), + }), ]; };