|
23 | 23 | id: deployment |
24 | 24 | with: |
25 | 25 | result-encoding: string |
26 | | - retries: 3 |
27 | 26 | script: | |
28 | 27 | const response = await github.rest.repos.createDeployment({ |
29 | 28 | issue_number: context.issue.number, |
|
43 | 42 | description: "Deployment created", |
44 | 43 | }) |
45 | 44 |
|
46 | | - return { deploymentId: response.data.id } |
| 45 | + return response.data.id |
47 | 46 | |
48 | 47 |
|
49 | 48 | # - name: Delete a comment if exists |
@@ -101,27 +100,27 @@ jobs: |
101 | 100 |
|
102 | 101 | - name: Update deployment status |
103 | 102 | uses: actions/github-script@v7 |
104 | | - if: steps.deployment.outputs.result.deploymentId |
| 103 | + if: steps.deployment.outputs.result |
105 | 104 | with: |
106 | 105 | script: | |
107 | 106 | await github.rest.repos.createDeploymentStatus({ |
108 | 107 | owner: context.repo.owner, |
109 | 108 | repo: context.repo.repo, |
110 | | - deployment_id: ${{ steps.deployment.outputs.result.deploymentId }}, |
| 109 | + deployment_id: ${{ steps.deployment.outputs.result }}, |
111 | 110 | state: "success", |
112 | 111 | description: "Deployment completed", |
113 | 112 | target_url: `https://d2euvt1bxklciq.cloudfront.net/${process.env.GITHUB_REPOSITORY}/pull/${{ github.event.pull_request.number}}`, |
114 | 113 | }) |
115 | 114 |
|
116 | 115 | - name: Update Deployment Status on Failure |
117 | | - if: failure() && steps.deployment.outputs.result.deploymentId |
| 116 | + if: failure() && steps.deployment.outputs.result |
118 | 117 | uses: actions/github-script@v7 |
119 | 118 | with: |
120 | 119 | script: | |
121 | 120 | await github.rest.repos.createDeploymentStatus({ |
122 | 121 | owner: context.repo.owner, |
123 | 122 | repo: context.repo.repo, |
124 | | - deployment_id: ${{ steps.deployment.outputs.result.deploymentId }}, |
| 123 | + deployment_id: ${{ steps.deployment.outputs.result }}, |
125 | 124 | state: "failure", |
126 | 125 | description: "Deployment failed", |
127 | 126 | }) |
|
0 commit comments