diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 0322825b..9e4c681d 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -55,13 +55,19 @@ jobs: name: dist-files path: dist + - name: Set short git commit SHA + id: vars + run: | + calculatedSha=$(echo ${{ github.event.pull_request.head.sha }} | head -c 8) + echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV + - name: Deploy to Cloudflare id: deploy uses: cloudflare/wrangler-action@v3 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - command: pages deploy dist --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME }} --branch ${{ github.event.pull_request.head.sha }} --commit-dirty=true + command: pages deploy dist --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME }} --branch=${{ env.COMMIT_SHORT_SHA }} --commit-dirty=true - name: Add deployment comment uses: thollander/actions-comment-pull-request@v3