Skip to content

Commit a84e3e8

Browse files
committed
help-commands
1 parent d688a87 commit a84e3e8

File tree

2 files changed

+62
-34
lines changed

2 files changed

+62
-34
lines changed

.github/workflows/help-command.yml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Show Help for Commands
1+
name: Show Detailed Help
22

33
on:
44
issue_comment:
@@ -27,9 +27,13 @@ jobs:
2727
with:
2828
script: |
2929
try {
30-
console.log('Creating help message...');
30+
console.log('Creating detailed help message...');
3131
const helpMessage = [
32-
'## 📚 Available Commands',
32+
'# 📚 Detailed Review App Commands Guide',
33+
'',
34+
'This is a detailed guide to using review app commands. For a quick reference, see the message posted when your PR was created.',
35+
'',
36+
'## Available Commands',
3337
'',
3438
'### `/deploy-review-app`',
3539
'Deploys your PR branch to a review environment on Control Plane.',
@@ -59,16 +63,30 @@ jobs:
5963
'- `CPLN_ORG`: Control Plane organization name',
6064
'',
6165
'### `/help`',
62-
'Shows this help message explaining available commands and configuration.',
66+
'Shows this detailed help message.',
6367
'',
6468
'---',
65-
'**Note:** These commands only work in pull request comments.',
69+
'## Environment Setup',
6670
'',
67-
'**Environment Setup:**',
6871
'1. Set required secrets in your repository settings:',
6972
' - `CPLN_TOKEN`',
7073
' - `CPLN_ORG`',
71-
'2. Optional: Configure `WAIT_TIMEOUT` in GitHub Actions variables to customize deployment timeout'
74+
'',
75+
'2. Optional: Configure `WAIT_TIMEOUT` in GitHub Actions variables to customize deployment timeout',
76+
'',
77+
'## Control Plane Integration',
78+
'',
79+
'Review apps are deployed to Control Plane with the following configuration:',
80+
'- App Name Format: `qa-react-webpack-rails-tutorial-pr-{PR_NUMBER}`',
81+
'- Console URL: `https://console.cpln.io/console/org/{CPLN_ORG}/gvc/{APP_NAME}/-info`',
82+
'',
83+
'## Automatic Cleanup',
84+
'',
85+
'Review apps are automatically deleted when:',
86+
'- The PR is closed (merged or not merged)',
87+
'- The PR is stale (via nightly cleanup job)',
88+
'',
89+
'For more information, see the [React on Rails Tutorial documentation](https://github.com/shakacode/react-on-rails/tree/master/react-webpack-rails-tutorial)'
7290
].join('\n');
7391
7492
console.log('Issue number:', github.context.payload.issue.number);

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

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,52 @@
1-
name: Review App Help
1+
name: Show Quick Help on PR Creation
22

33
on:
44
pull_request:
55
types: [opened]
6-
issue_comment:
7-
types: [created]
86

97
permissions:
10-
pull-requests: write
118
issues: write
9+
pull-requests: write
1210

1311
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')
12+
show-quick-help:
13+
if: github.event_name == 'pull_request'
2014
runs-on: ubuntu-latest
2115

2216
steps:
23-
- name: Post Help Message
17+
- name: Show Quick Reference
2418
uses: actions/github-script@v7
2519
with:
2620
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-
});
21+
try {
22+
console.log('Creating quick reference message...');
23+
const helpMessage = [
24+
'# 🚀 Quick Review App Commands',
25+
'',
26+
'Welcome! Here are the commands you can use in this PR:',
27+
'',
28+
'### `/deploy-review-app`',
29+
'Deploy your PR branch for testing',
30+
'',
31+
'### `/delete-review-app`',
32+
'Remove the review app when done',
33+
'',
34+
'### `/help`',
35+
'Show detailed documentation',
36+
'',
37+
'---',
38+
'**Note:** Type `/help` for detailed instructions, environment setup, and configuration options.'
39+
].join('\n');
40+
41+
await github.rest.issues.createComment({
42+
owner: context.repo.owner,
43+
repo: context.repo.repo,
44+
issue_number: context.issue.number,
45+
body: helpMessage
46+
});
47+
48+
console.log('Quick reference posted successfully');
49+
} catch (error) {
50+
console.error('Error posting quick reference:', error);
51+
core.setFailed(`Failed to post quick reference: ${error.message}`);
52+
}

0 commit comments

Comments
 (0)