@@ -18,6 +18,105 @@ jobs:
1818 github.event.comment.body == '/help')
1919 runs-on : ubuntu-latest
2020
21+ steps :
22+ - name : Show Available Commands
23+ uses : actions/github-script@v7
24+ with :
25+ script : |
26+ try {
27+ console.log('Creating detailed help message...');
28+ const helpMessage = [
29+ '# 📚 Detailed Review App Commands Guide',
30+ '',
31+ 'This is a detailed guide to using review app commands. For a quick reference, see the message posted when your PR was created.',
32+ '',
33+ '## Available Commands',
34+ '',
35+ '### `/deploy-review-app`',
36+ 'Deploys your PR branch to a review environment on Control Plane.',
37+ '- Creates a new review app if one doesn\'t exist',
38+ '- Updates the existing review app if it already exists',
39+ '- Provides a unique URL to preview your changes',
40+ '- Shows build and deployment progress in real-time',
41+ '',
42+ '**Required Environment Secrets:**',
43+ '- `CPLN_TOKEN_STAGING`: Control Plane authentication token',
44+ '- `CPLN_TOKEN_PRODUCTION`: Control Plane authentication token',
45+ '',
46+ '**Required GitHub Actions Variables:**',
47+ '- `CPLN_ORG_STAGING`: Control Plane authentication token',
48+ '- `CPLN_ORG_PRODUCTION`: Control Plane authentication token',
49+ '',
50+ '**Required GitHub Actions Variables (these need to match your control_plane.yml file:**',
51+ '- `PRODUCTION_APP_NAME`: Control Plane production app name',
52+ '- `STAGING_APP_NAME`: Control Plane staging app name',
53+ '- `REVIEW_APP_PREFIX`: Control Plane review app prefix',
54+ '',
55+ '**Optional Configuration:**',
56+ '- `WAIT_TIMEOUT`: Deployment timeout in seconds (default: 900)',
57+ ' - Must be a positive integer',
58+ ' - Can be set in GitHub Actions variables',
59+ ' - Applies to both deployment and workload readiness checks',
60+ '',
61+ '### `/delete-review-app`',
62+ 'Deletes the review app associated with this PR.',
63+ '- Removes all resources from Control Plane',
64+ '- Helpful for cleaning up when you\'re done testing',
65+ '- Can be re-deployed later using `/deploy-review-app`',
66+ '',
67+ '**Required Environment Variables:**',
68+ '- `CPLN_TOKEN`: Control Plane authentication token',
69+ '- `CPLN_ORG`: Control Plane organization name',
70+ '',
71+ '### `/help`',
72+ 'Shows this detailed help message.',
73+ '',
74+ '---',
75+ '## Environment Setup',
76+ '',
77+ '1. Set required secrets in your repository settings:',
78+ ' - `CPLN_TOKEN`',
79+ ' - `CPLN_ORG`',
80+ '',
81+ '2. Optional: Configure `WAIT_TIMEOUT` in GitHub Actions variables to customize deployment timeout',
82+ '',
83+ '## Control Plane Integration',
84+ '',
85+ 'Review apps are deployed to Control Plane with the following configuration:',
86+ '- App Name Format: `qa-react-webpack-rails-tutorial-pr-{PR_NUMBER}`',
87+ '- Console URL: `https://console.cpln.io/console/org/{CPLN_ORG}/gvc/{APP_NAME}/-info`',
88+ '',
89+ '## Automatic Cleanup',
90+ '',
91+ 'Review apps are automatically deleted when:',
92+ '- The PR is closed (merged or not merged)',
93+ '- The PR is stale (via nightly cleanup job)',
94+ '',
95+ 'For more information, see the [React on Rails Tutorial documentation](https://github.com/shakacode/react-on-rails/tree/master/react-webpack-rails-tutorial)'
96+ ].join('\n');
97+
98+ await github.rest.issues.createComment({
99+ owner: context.repo.owner,
100+ repo: context.repo.repo,
101+ issue_number: context.issue.number,
102+ name : Show Help for Commands
103+
104+ on :
105+ issue_comment :
106+ types : [created]
107+
108+ permissions :
109+ issues : write
110+ pull-requests : write
111+
112+ jobs :
113+ show-help :
114+ if : |
115+ github.event_name == 'issue_comment' &&
116+ github.event.issue.pull_request &&
117+ github.event.comment.body == '/help'
118+ runs-on : ubuntu-latest
119+
21120 steps :
22121 - name : Show Available Commands
23122 uses : actions/github-script@v7
0 commit comments