File tree Expand file tree Collapse file tree 2 files changed +4
-24
lines changed
actions/deploy-to-control-plane Expand file tree Collapse file tree 2 files changed +4
-24
lines changed Original file line number Diff line number Diff line change 6161 required_contexts: []
6262 });
6363
64- const prNumber = context.issue.number || context.payload.pull_request.number;
65-
66- // Get the job ID from the workflow run
67- const jobs = await github.rest.actions.listJobsForWorkflowRun({
68- owner: context.repo.owner,
69- repo: context.repo.repo,
70- run_id: context.runId
71- });
72-
73- const jobId = jobs.data.jobs.find(job => job.name === 'deploy')?.id;
74-
75- // Create initial comment
76- const comment = await github.rest.issues.createComment({
77- issue_number: prNumber,
78- owner: context.repo.owner,
79- repo: context.repo.repo,
80- body: `🚀 Starting deployment for PR ${prNumber}\nDeployment Log: ${process.env.GITHUB_SERVER_URL}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}/job/${jobId}?pr=${prNumber}`
81- });
82-
8364 // Set deployment status to in_progress
8465 await github.rest.repos.createDeploymentStatus({
8566 owner: context.repo.owner,
9071 });
9172
9273 return {
93- deploymentId: deployment.data.id,
94- commentId: comment.data.id
74+ deploymentId: deployment.data.id
9575 };
9676
9777 - name : Build Docker Image
Original file line number Diff line number Diff line change @@ -133,10 +133,10 @@ jobs:
133133 description: isSuccess ? '✅ Deployment successful' : '❌ Deployment failed'
134134 });
135135
136- // Update comment
136+ // Update the initial comment
137137 const message = isSuccess
138- ? `✅ Deployment successful! \n\n🚀 Rails app: ${railsUrl}\n📊 Status: ${process.env.GITHUB_SERVER_URL}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`
139- : `❌ Deployment failed\n\nCommit: ${context.sha.substring(0, 7)}\nWorkflow Status: ${process.env.GITHUB_SERVER_URL}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
138+ ? `✅ Deployment Successful for PR ${context.issue.number} \n\n🚀 Rails app: ${railsUrl}\n📊 Status: ${process.env.GITHUB_SERVER_URL}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`
139+ : `❌ Deployment failed for PR ${context.issue.number} \n\nCommit: ${context.sha.substring(0, 7)}\nWorkflow Status: ${process.env.GITHUB_SERVER_URL}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
140140
141141 await github.rest.issues.updateComment({
142142 owner: context.repo.owner,
You can’t perform that action at this time.
0 commit comments