@@ -148,14 +148,8 @@ jobs:
148
148
149
149
const workflowUrl = await getWorkflowUrl(context.runId);
150
150
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
- `);
157
151
158
- - name : Update Status - Building
152
+ - name : Set Console Link
159
153
if : |
160
154
(github.event_name == 'issue_comment' &&
161
155
github.event.issue.pull_request &&
@@ -164,14 +158,25 @@ jobs:
164
158
uses : actions/github-script@v7
165
159
with :
166
160
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);
168
164
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 : |
169
174
const buildingMessage = [
170
175
'🏗️ Building Docker image...',
171
176
'',
172
177
'📝 [View Build Logs](' + process.env.WORKFLOW_URL + ')',
173
178
'',
174
- getConsoleLink( process.env.PR_NUMBER)
179
+ process.env.CONSOLE_LINK
175
180
].join('\n');
176
181
177
182
await github.rest.issues.updateComment({
@@ -211,16 +216,14 @@ jobs:
211
216
uses : actions/github-script@v7
212
217
with :
213
218
script : |
214
- eval(process.env.GET_CONSOLE_LINK);
215
-
216
219
const deployingMessage = [
217
220
'🚀 Deploying to Control Plane...',
218
221
'',
219
222
'⏳ Waiting for deployment to be ready...',
220
223
'',
221
224
'📝 [View Deploy Logs](' + process.env.WORKFLOW_URL + ')',
222
225
'',
223
- getConsoleLink( process.env.PR_NUMBER)
226
+ process.env.CONSOLE_LINK
224
227
].join('\n');
225
228
226
229
await github.rest.issues.updateComment({
@@ -236,6 +239,7 @@ jobs:
236
239
github.event.issue.pull_request &&
237
240
github.event.comment.body == '/deploy-review-app') ||
238
241
(steps.get-pr.outputs.has_pr == 'true' && steps.check-app.outputs.app_exists == 'true')
242
+ id : deploy
239
243
uses : ./.github/actions/deploy-to-control-plane
240
244
with :
241
245
app_name : ${{ env.APP_NAME }}
@@ -251,16 +255,14 @@ jobs:
251
255
uses : actions/github-script@v7
252
256
with :
253
257
script : |
254
- eval(process.env.GET_CONSOLE_LINK);
255
-
256
258
const successMessage = [
257
259
'✅ Deployment successful!',
258
260
'',
259
- '🌐 Review app is ready at: ${{ env.REVIEW_APP_URL }}',
261
+ '🌐 Review app is ready at: ${{ steps.deploy.outputs.review_app_url }}',
260
262
'',
261
263
'📝 [View App Logs](' + process.env.WORKFLOW_URL + ')',
262
264
'',
263
- getConsoleLink( process.env.PR_NUMBER)
265
+ process.env.CONSOLE_LINK
264
266
].join('\n');
265
267
266
268
await github.rest.issues.updateComment({
0 commit comments