Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
reakaleek committed Jan 22, 2025
1 parent b54fefa commit 14239ba
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
Expand Down Expand Up @@ -104,18 +104,22 @@ 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",
target_url: `https://d2euvt1bxklciq.cloudfront.net/${process.env.GITHUB_REPOSITORY}/pull/${{ github.event.pull_request.number}}`,
})
- 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",
Expand Down

0 comments on commit 14239ba

Please sign in to comment.