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