diff options
author | 2021-01-21 00:13:01 +0300 | |
---|---|---|
committer | 2021-01-21 00:13:01 +0300 | |
commit | 5ba6e83d8a0f69a38829cb255548be2ee2fd60f4 (patch) | |
tree | 52cecdcec27f3b3cde5efdfac17b6673a3842ea5 | |
parent | Merge pull request #95 from python-discord/dependabot/npm_and_yarn/webpack-cl... (diff) |
Corrects SHA & Path In Workflow
Changes the sourcemap path to point to the location it is compiled to.
Dynamically determines the correct SHA to use for program compilation
and sentry release as it was incorrect for PRs due to the way github
actions work.
Signed-off-by: Hassan Abouelela <[email protected]>
-rw-r--r-- | .github/workflows/create_sentry_release.yml | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/.github/workflows/create_sentry_release.yml b/.github/workflows/create_sentry_release.yml index 4ae20bb..d258c5d 100644 --- a/.github/workflows/create_sentry_release.yml +++ b/.github/workflows/create_sentry_release.yml @@ -13,16 +13,23 @@ jobs: steps: - uses: actions/checkout@v2 - uses: EgorDm/gha-yarn-node-cache@v1 - + - name: Install dependencies run: yarn install - + + - name: Set SHA + id: commit-sha + run: | + if ${{ github.ref == 'refs/heads/main' }}; + then echo "::set-output name=sha::${{ github.sha }}"; + else echo "::set-output name=sha::${{ github.event.pull_request.head.sha }}"; + fi; + - name: Build application run: yarn build env: REACT_APP_SENTRY_DSN: ${{ secrets.SENTRY_DSN }} - REACT_APP_SHA: ${{ github.sha }} - REACT_APP_BRANCH: main + COMMIT_REF: ${{ steps.commit-sha.outputs.sha }} REACT_APP_OAUTH2_CLIENT_ID: ${{ secrets.CLIENT_ID }} - name: Create Sentry release (production) @@ -34,7 +41,8 @@ jobs: SENTRY_PROJECT: forms-frontend with: environment: production - sourcemaps: ./build/static/js/ + sourcemaps: ./build/ + version: ${{ steps.commit-sha.outputs.sha }} version_prefix: forms-frontend@ - name: Create Sentry release (deploy preview) @@ -46,5 +54,6 @@ jobs: SENTRY_PROJECT: forms-frontend with: environment: deploy-preview - sourcemaps: ./build/static/js/ + sourcemaps: ./build/ + version: ${{ steps.commit-sha.outputs.sha }} version_prefix: forms-frontend@ |