File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change 16
16
CPLN_ORG : ${{secrets.CPLN_ORG_STAGING}}
17
17
CPLN_TOKEN : ${{secrets.CPLN_TOKEN_STAGING}}
18
18
PR_NUMBER : ${{ github.event.pull_request.number || github.event.issue.number }}
19
- STATUS_URL : ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${{ github .job_id }}?pr=${{ github.event.pull_request.number || github.event.issue.number }}
19
+ STATUS_URL : ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${{ steps.get_job_id.outputs .job_id }}?pr=${{ github.event.pull_request.number || github.event.issue.number }}
20
20
21
21
jobs :
22
22
check-concurrent :
55
55
deployment_id : ${{ steps.create-deployment.outputs.result }}
56
56
57
57
steps :
58
+ - name : Get job ID
59
+ id : get_job_id
60
+ uses : actions/github-script@v7
61
+ with :
62
+ script : |
63
+ const { data: jobs } = await github.rest.actions.listJobsForWorkflowRun({
64
+ owner: context.repo.owner,
65
+ repo: context.repo.repo,
66
+ run_id: context.runId,
67
+ });
68
+
69
+ const currentJob = jobs.jobs.find(job => job.name === context.job);
70
+ const jobId = currentJob.id;
71
+
72
+ return jobId;
73
+
58
74
- name : Create comment
59
75
id : create-comment
60
76
uses : actions/github-script@v7
77
+ env :
78
+ JOB_ID : ${{ steps.get_job_id.outputs.result }}
61
79
with :
62
80
script : |
63
81
async function createComment(message) {
71
89
72
90
const message = `🚀 Starting new deployment for commit: ${context.sha.substring(0, 7)}
73
91
${context.payload.commits ? `\nChanges: ${context.payload.commits[0].message}` : ''}
74
- Status: ${{ env.STATUS_URL } }`;
92
+ Status: ${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}/job/${JOB_ID}?pr=${context.issue.number || context.payload.pull_request.number }`;
75
93
76
94
await createComment(message);
77
95
You can’t perform that action at this time.
0 commit comments