@@ -148,14 +148,8 @@ jobs:
148148
149149 const workflowUrl = await getWorkflowUrl(context.runId);
150150 core.exportVariable('WORKFLOW_URL', workflowUrl);
151- core.exportVariable('GET_CONSOLE_LINK', `
152- function getConsoleLink(prNumber) {
153- return '🎮 [Control Plane Console](' +
154- 'https://console.cpln.io/console/org/' + process.env.CPLN_ORG + '/gvc/' + process.env.APP_NAME + '/-info)';
155- }
156- `);
157151
158- - name : Update Status - Building
152+ - name : Set Console Link
159153 if : |
160154 (github.event_name == 'issue_comment' &&
161155 github.event.issue.pull_request &&
@@ -164,14 +158,25 @@ jobs:
164158 uses : actions/github-script@v7
165159 with :
166160 script : |
167- eval(process.env.GET_CONSOLE_LINK);
161+ const consoleLink = '🎮 [Control Plane Console](https://console.cpln.io/console/org/' +
162+ process.env.CPLN_ORG + '/gvc/' + process.env.APP_NAME + '/-info)';
163+ core.exportVariable('CONSOLE_LINK', consoleLink);
168164
165+ - name : Update Status - Building
166+ if : |
167+ (github.event_name == 'issue_comment' &&
168+ github.event.issue.pull_request &&
169+ github.event.comment.body == '/deploy-review-app') ||
170+ (steps.get-pr.outputs.has_pr == 'true' && steps.check-app.outputs.app_exists == 'true')
171+ uses : actions/github-script@v7
172+ with :
173+ script : |
169174 const buildingMessage = [
170175 '🏗️ Building Docker image...',
171176 '',
172177 '📝 [View Build Logs](' + process.env.WORKFLOW_URL + ')',
173178 '',
174- getConsoleLink( process.env.PR_NUMBER)
179+ process.env.CONSOLE_LINK
175180 ].join('\n');
176181
177182 await github.rest.issues.updateComment({
@@ -211,16 +216,14 @@ jobs:
211216 uses : actions/github-script@v7
212217 with :
213218 script : |
214- eval(process.env.GET_CONSOLE_LINK);
215-
216219 const deployingMessage = [
217220 '🚀 Deploying to Control Plane...',
218221 '',
219222 '⏳ Waiting for deployment to be ready...',
220223 '',
221224 '📝 [View Deploy Logs](' + process.env.WORKFLOW_URL + ')',
222225 '',
223- getConsoleLink( process.env.PR_NUMBER)
226+ process.env.CONSOLE_LINK
224227 ].join('\n');
225228
226229 await github.rest.issues.updateComment({
@@ -236,6 +239,7 @@ jobs:
236239 github.event.issue.pull_request &&
237240 github.event.comment.body == '/deploy-review-app') ||
238241 (steps.get-pr.outputs.has_pr == 'true' && steps.check-app.outputs.app_exists == 'true')
242+ id : deploy
239243 uses : ./.github/actions/deploy-to-control-plane
240244 with :
241245 app_name : ${{ env.APP_NAME }}
@@ -251,16 +255,14 @@ jobs:
251255 uses : actions/github-script@v7
252256 with :
253257 script : |
254- eval(process.env.GET_CONSOLE_LINK);
255-
256258 const successMessage = [
257259 '✅ Deployment successful!',
258260 '',
259- '🌐 Review app is ready at: ${{ env.REVIEW_APP_URL }}',
261+ '🌐 Review app is ready at: ${{ steps.deploy.outputs.review_app_url }}',
260262 '',
261263 '📝 [View App Logs](' + process.env.WORKFLOW_URL + ')',
262264 '',
263- getConsoleLink( process.env.PR_NUMBER)
265+ process.env.CONSOLE_LINK
264266 ].join('\n');
265267
266268 await github.rest.issues.updateComment({
0 commit comments