Skip to content

Commit 342c265

Browse files
committed
add log to what file is used
1 parent cb5ce31 commit 342c265

File tree

1 file changed

+10
-90
lines changed

1 file changed

+10
-90
lines changed

.github/workflows/help-command.yml

Lines changed: 10 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: Show Help for Commands
22

33
on:
4+
push:
5+
branches:
6+
- "**" # Trigger on all branches, including feature branches
47
issue_comment:
58
types: [created]
69
workflow_dispatch:
@@ -10,6 +13,13 @@ permissions:
1013
pull-requests: write
1114

1215
jobs:
16+
log-workflow-branch:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Identify Workflow Branch
20+
run:
21+
echo "Workflow branch ref: ${{ github.ref }}"
22+
1323
show-help:
1424
if: |
1525
github.event_name == 'workflow_dispatch' ||
@@ -95,96 +105,6 @@ jobs:
95105
'For more information, see the [React on Rails Tutorial documentation](https://github.com/shakacode/react-on-rails/tree/master/react-webpack-rails-tutorial)'
96106
].join('\n');
97107
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-
188108
await github.rest.issues.createComment({
189109
owner: context.repo.owner,
190110
repo: context.repo.repo,

0 commit comments

Comments
 (0)