Skip to content

Commit

Permalink
add log to what file is used
Browse files Browse the repository at this point in the history
  • Loading branch information
justin808 committed Jan 28, 2025
1 parent cb5ce31 commit 3ca76cd
Showing 1 changed file with 7 additions and 90 deletions.
97 changes: 7 additions & 90 deletions .github/workflows/help-command.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Show Help for Commands

on:
push:
branches:
- "**" # Trigger on all branches, including feature branches
issue_comment:
types: [created]
workflow_dispatch:
Expand All @@ -19,6 +22,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Identify Workflow Branch
run: |
echo "Workflow branch ref: ${{ github.ref }}"
- name: Show Available Commands
uses: actions/github-script@v7
with:
Expand Down Expand Up @@ -95,96 +102,6 @@ jobs:
'For more information, see the [React on Rails Tutorial documentation](https://github.com/shakacode/react-on-rails/tree/master/react-webpack-rails-tutorial)'
].join('\n');
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: Show Help for Commands

on:
issue_comment:
types: [created]

permissions:
issues: write
pull-requests: write

jobs:
show-help:
if: |
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
github.event.comment.body == '/help'
runs-on: ubuntu-latest

steps:
- name: Show Available Commands
uses: actions/github-script@v7
with:
script: |
try {
console.log('Creating detailed help message...');
const helpMessage = [
'# 📚 Detailed Review App Commands Guide',
'',
'This is a detailed guide to using review app commands. For a quick reference, see the message posted when your PR was created.',
'',
'## Available Commands',
'',
'### `/deploy-review-app`',
'Deploys your PR branch to a review environment on Control Plane.',
'- Creates a new review app if one doesn\'t exist',
'- Updates the existing review app if it already exists',
'- Provides a unique URL to preview your changes',
'- Shows build and deployment progress in real-time',
'',
'**Required Environment Variables:**',
'- `CPLN_TOKEN`: Control Plane authentication token',
'- `CPLN_ORG`: Control Plane organization name',
'',
'**Optional Configuration:**',
'- `WAIT_TIMEOUT`: Deployment timeout in seconds (default: 900)',
' - Must be a positive integer',
' - Can be set in GitHub Actions variables',
' - Applies to both deployment and workload readiness checks',
'',
'### `/delete-review-app`',
'Deletes the review app associated with this PR.',
'- Removes all resources from Control Plane',
'- Helpful for cleaning up when you\'re done testing',
'- Can be re-deployed later using `/deploy-review-app`',
'',
'**Required Environment Variables:**',
'- `CPLN_TOKEN`: Control Plane authentication token',
'- `CPLN_ORG`: Control Plane organization name',
'',
'### `/help`',
'Shows this detailed help message.',
'',
'---',
'## Environment Setup',
'',
'1. Set required secrets in your repository settings:',
' - `CPLN_TOKEN`',
' - `CPLN_ORG`',
'',
'2. Optional: Configure `WAIT_TIMEOUT` in GitHub Actions variables to customize deployment timeout',
'',
'## Control Plane Integration',
'',
'Review apps are deployed to Control Plane with the following configuration:',
'- App Name Format: `qa-react-webpack-rails-tutorial-pr-{PR_NUMBER}`',
'- Console URL: `https://console.cpln.io/console/org/{CPLN_ORG}/gvc/{APP_NAME}/-info`',
'',
'## Automatic Cleanup',
'',
'Review apps are automatically deleted when:',
'- The PR is closed (merged or not merged)',
'- The PR is stale (via nightly cleanup job)',
'',
'For more information, see the [React on Rails Tutorial documentation](https://github.com/shakacode/react-on-rails/tree/master/react-webpack-rails-tutorial)'
].join('\n');
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down

0 comments on commit 3ca76cd

Please sign in to comment.