2222 required : false
2323 type : string
2424 default : us-west-1
25+ require_sentry :
26+ description : " Require complete Sentry build configuration and source-map upload credentials"
27+ required : false
28+ type : boolean
29+ default : true
2530
2631jobs :
2732 build :
@@ -58,13 +63,14 @@ jobs:
5863 SENTRY_ORG : ${{ vars.SENTRY_ORG }}
5964 SENTRY_WEBAPP_PROJECT : ${{ vars.SENTRY_WEBAPP_PROJECT }}
6065 SENTRY_BACKEND_PROJECT : ${{ vars.SENTRY_BACKEND_PROJECT }}
66+ REQUIRE_SENTRY : ${{ inputs.require_sentry }}
6167 run : |
6268 missing=0
63- for name in SENTRY_AUTH_TOKEN AWS_ECR_ROLE_ARN \
64- NEXT_PUBLIC_SENTRY_ENVIRONMENT \
65- NEXT_PUBLIC_SENTRY_WEBAPP_DSN \
66- NEXT_PUBLIC_SENTRY_BACKEND_DSN \
67- SENTRY_ORG SENTRY_WEBAPP_PROJECT SENTRY_BACKEND_PROJECT ; do
69+ required_names=" AWS_ECR_ROLE_ARN"
70+ if [ "$REQUIRE_SENTRY" = "true" ]; then
71+ required_names="$required_names SENTRY_AUTH_TOKEN NEXT_PUBLIC_SENTRY_ENVIRONMENT NEXT_PUBLIC_SENTRY_WEBAPP_DSN NEXT_PUBLIC_SENTRY_BACKEND_DSN SENTRY_ORG SENTRY_WEBAPP_PROJECT SENTRY_BACKEND_PROJECT"
72+ fi
73+ for name in $required_names ; do
6874 if [ -z "${!name}" ]; then
6975 echo "::error::${name} is not set on the '${ENVIRONMENT}' environment (or the repository)."
7076 missing=1
7379 fi
7480 done
7581 if [ "$missing" -ne 0 ]; then
76- echo "::error::Refusing to build: the image would ship without Sentry wiring ."
82+ echo "::error::Refusing to build: required environment configuration is missing ."
7783 exit 1
7884 fi
85+ if [ "$REQUIRE_SENTRY" != "true" ]; then
86+ echo "Sentry wiring is intentionally disabled for the isolated internal demo image."
87+ fi
7988
8089 - name : Check Prisma migrations
8190 uses : ./.github/actions/check-prisma-migrations
@@ -128,8 +137,7 @@ jobs:
128137 SENTRY_RELEASE=${{ steps.commit.outputs.sha }}
129138 # Passed as a secret, not a build-arg: build args are recorded in layer
130139 # metadata that `mode=max` exports to the cache. @see: Dockerfile
131- secrets : |
132- sentry_auth_token=${{ secrets.SENTRY_AUTH_TOKEN }}
140+ secrets : ${{ inputs.require_sentry && format('sentry_auth_token={0}', secrets.SENTRY_AUTH_TOKEN) || '' }}
133141 # Cache scope is per-environment, and distinct from the OSS build's
134142 # (which is keyed on platform alone). Sharing a scope would let a build
135143 # that never sees SENTRY_AUTH_TOKEN restore layers from one that did.
@@ -141,15 +149,20 @@ jobs:
141149 ENVIRONMENT : ${{ inputs.environment }}
142150 COMMIT_SHA : ${{ steps.commit.outputs.sha }}
143151 TAGS : ${{ steps.meta.outputs.tags }}
152+ REQUIRE_SENTRY : ${{ inputs.require_sentry }}
144153 run : |
154+ sentry_summary="disabled"
155+ if [ "$REQUIRE_SENTRY" = "true" ]; then
156+ sentry_summary="$COMMIT_SHA"
157+ fi
145158 {
146159 echo "### Pushed to ECR"
147160 echo
148161 echo "| | |"
149162 echo "|---|---|"
150163 echo "| Environment | \`${ENVIRONMENT}\` |"
151164 echo "| Commit | \`${COMMIT_SHA}\` |"
152- echo "| Sentry release | \`${COMMIT_SHA }\` |"
165+ echo "| Sentry | \`${sentry_summary }\` |"
153166 echo
154167 echo '```'
155168 echo "$TAGS"
0 commit comments