Skip to content

Commit 424b954

Browse files
committed
add log to what file is used
1 parent cb5ce31 commit 424b954

File tree

1 file changed

+11
-90
lines changed

1 file changed

+11
-90
lines changed

.github/workflows/help-command.yml

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

33
on:
4+
on:
5+
push:
6+
branches:
7+
- "**" # Trigger on all branches, including feature branches
48
issue_comment:
59
types: [created]
610
workflow_dispatch:
@@ -10,6 +14,13 @@ permissions:
1014
pull-requests: write
1115

1216
jobs:
17+
log-workflow-branch:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Identify Workflow Branch
21+
run:
22+
echo "Workflow branch ref: ${{ github.ref }}"
23+
1324
show-help:
1425
if: |
1526
github.event_name == 'workflow_dispatch' ||
@@ -95,96 +106,6 @@ jobs:
95106
'For more information, see the [React on Rails Tutorial documentation](https://github.com/shakacode/react-on-rails/tree/master/react-webpack-rails-tutorial)'
96107
].join('\n');
97108
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-
188109
await github.rest.issues.createComment({
189110
owner: context.repo.owner,
190111
repo: context.repo.repo,

0 commit comments

Comments
 (0)