From 87e0d8148fc0a8ffa9793d3c15da726cb1551615 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Sun, 21 Jul 2024 12:40:50 +0800 Subject: [PATCH] :construction_worker: Fix: preview alias and commit status (#2831) --- .github/workflows/website-preview-cd.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/website-preview-cd.yml b/.github/workflows/website-preview-cd.yml index ac481763..ac8edbe4 100644 --- a/.github/workflows/website-preview-cd.yml +++ b/.github/workflows/website-preview-cd.yml @@ -43,9 +43,12 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} run-id: ${{ github.event.workflow_run.id }} - - name: Restore Context and Set Deploy Name + - name: Restore Context run: | cat action.env >> $GITHUB_ENV + + - name: Set Deploy Name + run: | echo "DEPLOY_NAME=deploy-preview-${{ env.PR_NUMBER }}" >> $GITHUB_ENV - name: Deploy to Netlify @@ -74,7 +77,7 @@ jobs: if: always() with: script: | - if (context.job.status === 'success') { + if (`${{ job.status }}` === 'success') { github.rest.repos.createCommitStatus({ owner: context.repo.owner, repo: context.repo.repo, @@ -90,7 +93,7 @@ jobs: repo: context.repo.repo, sha: context.payload.workflow_run.head_sha, context: 'Website Preview', - description: 'Deploy ' + context.job.status, + description: `Deploy ${{ job.status }}`, state: 'failure', }) }