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 1616 CPLN_ORG : ${{secrets.CPLN_ORG_STAGING}}
1717 CPLN_TOKEN : ${{secrets.CPLN_TOKEN_STAGING}}
1818 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 }}
2020
2121jobs :
2222 check-concurrent :
5555 deployment_id : ${{ steps.create-deployment.outputs.result }}
5656
5757 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+
5874 - name : Create comment
5975 id : create-comment
6076 uses : actions/github-script@v7
77+ env :
78+ JOB_ID : ${{ steps.get_job_id.outputs.result }}
6179 with :
6280 script : |
6381 async function createComment(message) {
7189
7290 const message = `🚀 Starting new deployment for commit: ${context.sha.substring(0, 7)}
7391 ${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 }`;
7593
7694 await createComment(message);
7795
You can’t perform that action at this time.
0 commit comments