👷 Fix: preview alias and commit status (#2831)

This commit is contained in:
Ju4tCode 2024-07-21 12:40:50 +08:00 committed by GitHub
parent 53d8989145
commit 87e0d8148f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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',
})
}