From ff84749cef0818173ce299573a063ee300ad850d Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Thu, 9 Dec 2021 16:34:17 +0100 Subject: [PATCH 1/3] fix(Sentry): use correct release --- config/environment.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/environment.js b/config/environment.js index bf8049075..4f6a3a526 100644 --- a/config/environment.js +++ b/config/environment.js @@ -124,7 +124,7 @@ module.exports = function(environment) { sentry: { dsn: 'https://invalid@xx.ingest.sentry.io/12345', // invalid key, will be replaced when run as prod environment: deployTarget, - release: `amber-ui@${process.env.BUILD_HASH}` + release: process.env.BUILD_HASH } }; From 0d1c8a1ca31ff6f917bc8b20cf814d699ed37169 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Sun, 12 Dec 2021 21:49:48 +0100 Subject: [PATCH 2/3] fix: remove environment from Sentry release action so it doesn't create a deployment --- .github/workflows/continuous-delivery.yml | 1 + .github/workflows/publish-image.yml | 8 +------- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml index d4808f521..840189e86 100644 --- a/.github/workflows/continuous-delivery.yml +++ b/.github/workflows/continuous-delivery.yml @@ -170,6 +170,7 @@ jobs: SENTRY_PROJECT: ${{ env.PROJECT_NAME }} with: environment: ${{ needs.metadata.outputs.stage }} + version: ${{ needs.merge.outputs.sha }} set_commits: skip - name: Finish deployment diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml index fcb2d8db1..6af3195d6 100644 --- a/.github/workflows/publish-image.yml +++ b/.github/workflows/publish-image.yml @@ -43,12 +43,6 @@ jobs: fi BUILD_ARGS=${BUILD_ARGS//$'\n'/'%0A'} echo '::set-output name=build_args::'$BUILD_ARGS - - if [ $GITHUB_REF_NAME = 'master' ]; then - echo '::set-output name=stage::production' - else - echo '::set-output name=stage::staging' - fi fi publish: @@ -99,9 +93,9 @@ jobs: SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} SENTRY_PROJECT: ${{ env.PROJECT_NAME }} with: - environment: ${{ needs.metadata.outputs.stage }} finalize: false sourcemaps: sourcemaps + version: ${{ github.event.inputs.sha }} url_prefix: ~/assets/ update_check_run: From 357cddfea416871adcbd2529ad962bb4374b9d9c Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Thu, 16 Dec 2021 15:28:04 +0100 Subject: [PATCH 3/3] fix: pass correct build hash into build --- .github/workflows/publish-image.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml index 6af3195d6..3683e4098 100644 --- a/.github/workflows/publish-image.yml +++ b/.github/workflows/publish-image.yml @@ -29,6 +29,8 @@ jobs: steps: - name: Get metadata id: get_metadata + env: + INPUT_SHA: ${{ inputs.sha }} run: | if [ $GITHUB_REF_NAME = 'master' ]; then echo '::set-output name=tag::latest' @@ -37,7 +39,7 @@ jobs: fi if [ $GITHUB_REF_NAME = 'staging' ] || [ $GITHUB_REF_NAME = 'master' ]; then - BUILD_ARGS='BUILD_HASH='$GITHUB_SHA + BUILD_ARGS='BUILD_HASH='${INPUT_SHA:-GITHUB_SHA} if [ $GITHUB_REF_NAME = 'staging' ]; then BUILD_ARGS+=$'\nDEPLOY_TARGET=staging' fi @@ -95,7 +97,7 @@ jobs: with: finalize: false sourcemaps: sourcemaps - version: ${{ github.event.inputs.sha }} + version: ${{ inputs.sha }} url_prefix: ~/assets/ update_check_run: