@@ -25,40 +25,40 @@ jobs:
2525 echo "PR number: $pr_number"
2626 echo "::set-output name=prnumber::$pr_number"
2727
28- - name : Create Deployment ID
29- uses : altinukshini/deployment-action @v1.2.6
28+ - name : Create Deployment
29+ uses : bobheadxi/deployments @v1
3030 id : deployment
3131 with :
32- token : " ${{ secrets.ELEMENT_BOT_TOKEN }}"
33- pr : true
34- pr_id : ${{ steps.readctx.outputs.prnumber }}
35- transient_environment : true
36- environment : Netlify
37- initial_status : in_progress
32+ step : start
33+ token : ${{ secrets.GITHUB_TOKEN }}
34+ env : Netlify
3835 ref : ${{ github.event.workflow_run.head_sha }}
36+ desc : |
37+ Do you trust the author of this PR? Maybe this build will steal your keys or give you malware.
38+ Exercise caution. Use test accounts.
3939
40- # There's a 'download artifact' action but it hasn't been updated for the
40+ # There's a 'download artifact' action, but it hasn't been updated for the
4141 # workflow_run action (https://github.com/actions/download-artifact/issues/60)
4242 # so instead we get this mess:
4343 - name : ' Download artifact'
4444 uses : actions/github-script@v3.1.0
4545 with :
4646 script : |
47- var artifacts = await github.actions.listWorkflowRunArtifacts({
48- owner: context.repo.owner,
49- repo: context.repo.repo,
50- run_id: ${{github.event.workflow_run.id }},
47+ const artifacts = await github.actions.listWorkflowRunArtifacts({
48+ owner: context.repo.owner,
49+ repo: context.repo.repo,
50+ run_id: ${{ github.event.workflow_run.id }},
5151 });
52- var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
53- return artifact.name == "previewbuild"
52+ const matchArtifact = artifacts.data.artifacts.filter((artifact) => {
53+ return artifact.name == "previewbuild"
5454 })[0];
55- var download = await github.actions.downloadArtifact({
56- owner: context.repo.owner,
57- repo: context.repo.repo,
58- artifact_id: matchArtifact.id,
59- archive_format: 'zip',
55+ const download = await github.actions.downloadArtifact({
56+ owner: context.repo.owner,
57+ repo: context.repo.repo,
58+ artifact_id: matchArtifact.id,
59+ archive_format: 'zip',
6060 });
61- var fs = require('fs');
61+ const fs = require('fs');
6262 fs.writeFileSync('${{github.workspace}}/previewbuild.zip', Buffer.from(download.data));
6363
6464 - name : Extract Artifacts
@@ -79,25 +79,16 @@ jobs:
7979 NETLIFY_SITE_ID : ${{ secrets.NETLIFY_SITE_ID }}
8080 timeout-minutes : 1
8181
82- - name : Update deployment status (success)
83- if : success()
84- uses : altinukshini/deployment-status@v1.0.1
82+ - name : Update deployment status
83+ uses : bobheadxi/deployments@v1
84+ if : always()
8585 with :
86- token : " ${{ secrets.ELEMENT_BOT_TOKEN }}"
87- environment_url : ${{ steps.netlify.outputs.deploy-url }}
88- state : " success"
86+ step : finish
87+ token : ${{ secrets.GITHUB_TOKEN }}
88+ status : ${{ job.status }}
89+ env : ${{ steps.deployment.outputs.env }}
8990 deployment_id : ${{ steps.deployment.outputs.deployment_id }}
90- pr : true
91- pr_id : ${{ steps.readctx.outputs.prnumber }}
92- description : |
91+ env_url : ${{ steps.netlify.outputs.deploy-url }}
92+ desc : |
9393 Do you trust the author of this PR? Maybe this build will steal your keys or give you malware.
9494 Exercise caution. Use test accounts.
95- - name : Update deployment status (failure)
96- if : failure()
97- uses : altinukshini/deployment-status@v1.0.1
98- with :
99- token : " ${{ secrets.ELEMENT_BOT_TOKEN }}"
100- state : " failure"
101- deployment_id : ${{ steps.deployment.outputs.deployment_id }}
102- pr : true
103- pr_id : ${{ steps.readctx.outputs.prnumber }}
0 commit comments