Skip to content

Commit

Permalink
fix(ci): use correct commit sha in pr deployments (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
timonmasberg committed Aug 10, 2023
1 parent 489c8af commit 96f673e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/preview-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ jobs:
- uses: actions/checkout@v3
with:
ref: refs/pull/${{ github.event.issue.number }}/head
- name: Set PR SHA
id: set-pr-sha
run: |
head_sha=$(git rev-parse HEAD)
echo "::set-output name=head_sha::$head_sha"
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
Expand Down Expand Up @@ -98,7 +103,7 @@ jobs:
uses: ./.github/actions/build-and-deploy-api
with:
slot: "pr${{ github.event.issue.number }}"
releaseVersion: ${{ github.event.issue.pull_request.head.sha }}
releaseVersion: ${{ steps.set-pr-sha.outputs.head_sha }}
sentryKey: ${{ secrets.API_SENTRY_KEY }}
sentryAuthToken: ${{ secrets.SENTRY_AUTH_TOKEN }}
containerRegistryUrl: ghcr.io
Expand All @@ -110,7 +115,7 @@ jobs:
with:
apiUrl: ${{ steps.api-deployment.outputs.url }}
oauthConfig: ${{ secrets.DEV_OAUTH_CONFIG }}
releaseVersion: ${{ github.event.issue.pull_request.head.sha }}
releaseVersion: ${{ steps.set-pr-sha.outputs.head_sha }}
deploymentEnv: "pr${{ github.event.issue.number }}"
publishToken: ${{ secrets.AZURE_STATIC_WEB_APP_TOKEN }}
sentryKey: ${{ secrets.SPA_SENTRY_KEY }}
Expand All @@ -124,7 +129,7 @@ jobs:
### 🚀 Deployment Preview
SPA: ${{ steps.spa-deployment.outputs.url }}
API: ${{ steps.api-deployment.outputs.url }}
Commit SHA: ${{ github.event.issue.pull_request.head.sha }}
Commit SHA: ${{ steps.set-pr-sha.outputs.head_sha }}
reactions: "rocket"
- name: AZ B2C Tenant Login
uses: azure/login@v1.4.7
Expand Down Expand Up @@ -185,7 +190,7 @@ jobs:
uses: ./.github/actions/build-and-deploy-api
with:
slot: "pr${{ github.event.pull_request.number }}"
releaseVersion: ${{ github.event.pull_request.head.sha }}
releaseVersion: ${{ github.event.pull_request.head.sha }}
sentryKey: ${{ secrets.API_SENTRY_KEY }}
sentryAuthToken: ${{ secrets.SENTRY_AUTH_TOKEN }}
containerRegistryUrl: ghcr.io
Expand Down

0 comments on commit 96f673e

Please sign in to comment.