Skip to content

Commit

Permalink
fix(sentry): Syntax and sentry workflow var updates (#1353)
Browse files Browse the repository at this point in the history
  • Loading branch information
adonispuente authored Jan 29, 2025
1 parent 310a3f0 commit 39096ad
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 26 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/webpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
34 changes: 18 additions & 16 deletions fec.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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://[email protected]/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://[email protected]/4505397435367424`,
org: 'red-hat-it',
project: 'advisor-rhel',
release,
}),
}),
]
: []),
],
moduleFederation: {
shared: [
Expand Down

0 comments on commit 39096ad

Please sign in to comment.