diff --git a/.github/workflows/webpack.yml b/.github/workflows/webpack.yml index a3e63b451..0eece5049 100644 --- a/.github/workflows/webpack.yml +++ b/.github/workflows/webpack.yml @@ -27,15 +27,9 @@ jobs: - name: Build env: - SENTRY_RELEASE: ${{ github.event.inputs.commit_hash || github.sha }} - SENTRY_AUTH_TOKEN: ${{ github.event.inputs.commit_hash && secrets.SENTRY_AUTH_TOKEN || 'null' }} + ENABLE_SENTRY: ${{ secrets.ENABLE_SENTRY }} + SENTRY_RELEASE: ${{ github.event.inputs.commit_hash && github.event.inputs.commit_hash }} + SENTRY_AUTH_TOKEN: ${{ github.event.inputs.commit_hash && secrets.SENTRY_AUTH_TOKEN }} SENTRY_ORG: ${{ secrets.SENTRY_ORG }} SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} - run: | - if [[ -z "${{ secrets.SENTRY_AUTH_TOKEN }}" ]]; then - echo "Building without SENTRY_AUTH_TOKEN" - npm run build --if-present - else - echo "Building with SENTRY_AUTH_TOKEN" - npm run build --if-present - fi + run: npm run build --if-present diff --git a/fec.config.js b/fec.config.js index a3d46b6fe..81232fe5a 100644 --- a/fec.config.js +++ b/fec.config.js @@ -8,22 +8,24 @@ module.exports = { proxyVerbose: false, devtool: 'hidden-source-map', plugins: [ - //Sentry Plugin should be at the end - process.env.ENABLE_SENTRY && [ - sentryWebpackPlugin({ - ...(process.env.SENTRY_AUTH_TOKEN && { - authToken: process.env.SENTRY_AUTH_TOKEN, - }), - org: 'red-hat-it', - project: 'advisor-rhel', - moduleMetadata: ({ release }) => ({ - dsn: `https://f8eb44de949e487e853185c09340f3cf@o490301.ingest.us.sentry.io/4505397435367424`, - org: 'red-hat-it', - project: 'advisor-rhel', - release, - }), - }), - ], + // Put the Sentry Webpack plugin after all other plugins + ...(process.env.ENABLE_SENTRY + ? [ + sentryWebpackPlugin({ + ...(process.env.SENTRY_AUTH_TOKEN && { + authToken: process.env.SENTRY_AUTH_TOKEN, + }), + org: 'red-hat-it', + project: 'advisor-rhel', + moduleMetadata: ({ release }) => ({ + dsn: `https://f8eb44de949e487e853185c09340f3cf@o490301.ingest.us.sentry.io/4505397435367424`, + org: 'red-hat-it', + project: 'advisor-rhel', + release, + }), + }), + ] + : []), ], moduleFederation: { shared: [