Skip to content

Commit

Permalink
fix(sentry): Update sentry flow (#2363)
Browse files Browse the repository at this point in the history
  • Loading branch information
adonispuente authored Jan 29, 2025
1 parent a2b9715 commit 5a21619
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 24 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
name: sentryConfig
name: sentryInit

on:
push:
branches:
- master
workflow_dispatch:
inputs:
commit_hash:
description: 'The commit hash (or branch/tag) to build'
required: true
default: 'master'
required: false
default: ''

jobs:
createSentryRelease:
Expand All @@ -15,17 +18,16 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.commit_hash }}
ref: ${{ github.event.inputs.commit_hash || 'refs/heads/master' }}

- name: Install dependencies
env:
SENTRY_RELEASE: ${{ github.event.inputs.commit_hash }}
run: npm ci

- name: Build
env:
SENTRY_RELEASE: ${{ github.event.inputs.commit_hash }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
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: npm run build --if-present
21 changes: 5 additions & 16 deletions fec.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,12 @@ module.exports = {
useProxy: process.env.PROXY === 'true',
devtool: 'hidden-source-map',
plugins: [
// Put the Sentry Webpack plugin after all other plugins
...(process.env.SENTRY_AUTH_TOKEN
...(process.env.ENABLE_SENTRY
? [
sentryWebpackPlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'red-hat-it',
project: 'compliance-rhel',
moduleMetadata: ({ release }) => ({
dsn: `https://[email protected]/4508083145408512`,
org: 'red-hat-it',
project: 'compliance-rhel',
release,
...(process.env.SENTRY_AUTH_TOKEN && {
authToken: process.env.SENTRY_AUTH_TOKEN,
}),
}),
]
: [
//Just injects debugIDs
sentryWebpackPlugin({
org: 'red-hat-it',
project: 'compliance-rhel',
moduleMetadata: ({ release }) => ({
Expand All @@ -47,7 +35,8 @@ module.exports = {
release,
}),
}),
]),
]
: []),
],
moduleFederation: {
shared: [
Expand Down

0 comments on commit 5a21619

Please sign in to comment.