|
1 | 1 | name: Show Help for Commands |
2 | 2 |
|
3 | 3 | on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - "**" # Trigger on all branches, including feature branches |
4 | 7 | issue_comment: |
5 | 8 | types: [created] |
6 | 9 | workflow_dispatch: |
|
19 | 22 | runs-on: ubuntu-latest |
20 | 23 |
|
21 | 24 | steps: |
| 25 | + - name: Identify Workflow Branch |
| 26 | + run: | |
| 27 | + echo "Workflow branch ref: ${{ github.ref }}" |
| 28 | + |
22 | 29 | - name: Show Available Commands |
23 | 30 | uses: actions/github-script@v7 |
24 | 31 | with: |
@@ -95,96 +102,6 @@ jobs: |
95 | 102 | 'For more information, see the [React on Rails Tutorial documentation](https://github.com/shakacode/react-on-rails/tree/master/react-webpack-rails-tutorial)' |
96 | 103 | ].join('\n'); |
97 | 104 | |
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 | | - |
120 | | - steps: |
121 | | - - name: Show Available Commands |
122 | | - uses: actions/github-script@v7 |
123 | | - with: |
124 | | - script: | |
125 | | - try { |
126 | | - console.log('Creating detailed help message...'); |
127 | | - const helpMessage = [ |
128 | | - '# 📚 Detailed Review App Commands Guide', |
129 | | - '', |
130 | | - 'This is a detailed guide to using review app commands. For a quick reference, see the message posted when your PR was created.', |
131 | | - '', |
132 | | - '## Available Commands', |
133 | | - '', |
134 | | - '### `/deploy-review-app`', |
135 | | - 'Deploys your PR branch to a review environment on Control Plane.', |
136 | | - '- Creates a new review app if one doesn\'t exist', |
137 | | - '- Updates the existing review app if it already exists', |
138 | | - '- Provides a unique URL to preview your changes', |
139 | | - '- Shows build and deployment progress in real-time', |
140 | | - '', |
141 | | - '**Required Environment Variables:**', |
142 | | - '- `CPLN_TOKEN`: Control Plane authentication token', |
143 | | - '- `CPLN_ORG`: Control Plane organization name', |
144 | | - '', |
145 | | - '**Optional Configuration:**', |
146 | | - '- `WAIT_TIMEOUT`: Deployment timeout in seconds (default: 900)', |
147 | | - ' - Must be a positive integer', |
148 | | - ' - Can be set in GitHub Actions variables', |
149 | | - ' - Applies to both deployment and workload readiness checks', |
150 | | - '', |
151 | | - '### `/delete-review-app`', |
152 | | - 'Deletes the review app associated with this PR.', |
153 | | - '- Removes all resources from Control Plane', |
154 | | - '- Helpful for cleaning up when you\'re done testing', |
155 | | - '- Can be re-deployed later using `/deploy-review-app`', |
156 | | - '', |
157 | | - '**Required Environment Variables:**', |
158 | | - '- `CPLN_TOKEN`: Control Plane authentication token', |
159 | | - '- `CPLN_ORG`: Control Plane organization name', |
160 | | - '', |
161 | | - '### `/help`', |
162 | | - 'Shows this detailed help message.', |
163 | | - '', |
164 | | - '---', |
165 | | - '## Environment Setup', |
166 | | - '', |
167 | | - '1. Set required secrets in your repository settings:', |
168 | | - ' - `CPLN_TOKEN`', |
169 | | - ' - `CPLN_ORG`', |
170 | | - '', |
171 | | - '2. Optional: Configure `WAIT_TIMEOUT` in GitHub Actions variables to customize deployment timeout', |
172 | | - '', |
173 | | - '## Control Plane Integration', |
174 | | - '', |
175 | | - 'Review apps are deployed to Control Plane with the following configuration:', |
176 | | - '- App Name Format: `qa-react-webpack-rails-tutorial-pr-{PR_NUMBER}`', |
177 | | - '- Console URL: `https://console.cpln.io/console/org/{CPLN_ORG}/gvc/{APP_NAME}/-info`', |
178 | | - '', |
179 | | - '## Automatic Cleanup', |
180 | | - '', |
181 | | - 'Review apps are automatically deleted when:', |
182 | | - '- The PR is closed (merged or not merged)', |
183 | | - '- The PR is stale (via nightly cleanup job)', |
184 | | - '', |
185 | | - 'For more information, see the [React on Rails Tutorial documentation](https://github.com/shakacode/react-on-rails/tree/master/react-webpack-rails-tutorial)' |
186 | | - ].join('\n'); |
187 | | - |
188 | 105 | await github.rest.issues.createComment({ |
189 | 106 | owner: context.repo.owner, |
190 | 107 | repo: context.repo.repo, |
|
0 commit comments