diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index dfe8e66..3c13e22 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -29,7 +29,7 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - ref: context.ref, + ref: context.sha, transient_environment: true, environment: `preview-${context.issue.number}`, description: `Preview deployment for PR ${context.issue.number}`, @@ -104,6 +104,8 @@ jobs: with: script: | await github.rest.repos.createDeploymentStatus({ + owner: context.repo.owner, + repo: context.repo.repo, deployment_id: ${{ steps.deployment.outputs.result.deploymentId }}, state: "success", description: "Deployment completed", @@ -111,11 +113,13 @@ jobs: }) - name: Update Deployment Status on Failure - if: failure() && steps.deployment.outputs.result.deploymentId + if: !success() && steps.deployment.outputs.result.deploymentId uses: actions/github-script@v7 with: script: | await github.rest.repos.createDeploymentStatus({ + owner: context.repo.owner, + repo: context.repo.repo, deployment_id: ${{ steps.deployment.outputs.result.deploymentId }}, state: "failure", description: "Deployment failed",