Skip to content

Commit d688a87

Browse files
committed
big-refactor-might-not-work
1 parent 1917948 commit d688a87

File tree

2 files changed

+46
-4
lines changed

2 files changed

+46
-4
lines changed

.github/workflows/delete-review-app.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ jobs:
5555
script: |
5656
core.exportVariable('GET_CONSOLE_LINK', `
5757
function getConsoleLink(prNumber) {
58-
return ' [Control Plane Console for Review App with PR #' + prNumber + '](' +
59-
'https://console.cpln.io/org/' + process.env.CPLN_ORG + '/workloads/' + process.env.APP_NAME + ')';
58+
return '🎮 [Control Plane Console](' +
59+
'https://console.cpln.io/console/org/' + process.env.CPLN_ORG + '/gvc/' + process.env.APP_NAME + '/-info)';
6060
}
6161
`);
6262
63-
- name: Initialize Workflow
64-
id: init-workflow
63+
- name: Setup Workflow URL
64+
id: setup-workflow-url
6565
uses: actions/github-script@v7
6666
with:
6767
script: |

.github/workflows/review-app-help.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Review App Help
2+
3+
on:
4+
pull_request:
5+
types: [opened]
6+
issue_comment:
7+
types: [created]
8+
9+
permissions:
10+
pull-requests: write
11+
issues: write
12+
13+
jobs:
14+
Post-Help-Message:
15+
if: |
16+
(github.event_name == 'pull_request') ||
17+
(github.event_name == 'issue_comment' &&
18+
github.event.issue.pull_request &&
19+
github.event.comment.body == '/show-help')
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Post Help Message
24+
uses: actions/github-script@v7
25+
with:
26+
script: |
27+
const helpMessage = [
28+
'## Review App Commands',
29+
'',
30+
'- `/deploy-review-app` - Deploy a review app for this PR',
31+
'- `/delete-review-app` - Delete the review app for this PR',
32+
'- `/show-help` - Show this help message',
33+
'',
34+
'The review app will be automatically deleted when the PR is closed or merged.'
35+
].join('\n');
36+
37+
await github.rest.issues.createComment({
38+
owner: context.repo.owner,
39+
repo: context.repo.repo,
40+
issue_number: context.issue.number || context.payload.pull_request.number,
41+
body: helpMessage
42+
});

0 commit comments

Comments
 (0)