Skip to content

Commit cb5ce31

Browse files
committed
fix issues related to new secrets/variables
1 parent 813130a commit cb5ce31

File tree

4 files changed

+107
-8
lines changed

4 files changed

+107
-8
lines changed

.github/workflows/delete-review-app.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ permissions:
1313
issues: write
1414

1515
env:
16-
CPLN_ORG: ${{ secrets.CPLN_ORG_STAGING }}
17-
CPLN_TOKEN: ${{ secrets.CPLN_TOKEN }}
16+
CPLN_ORG: ${{ vars.CPLN_ORG_STAGING }}
17+
CPLN_TOKEN: ${{ secrets.CPLN_TOKEN_STAGING }}
1818
APP_NAME: qa-react-webpack-rails-tutorial-pr-${{ github.event.pull_request.number || github.event.issue.number }}
1919
PR_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }}
2020

.github/workflows/deploy-to-control-plane-staging.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ on:
1313

1414
# Convert the GitHub secret variables to environment variables for use by the Control Plane CLI
1515
env:
16-
CPLN_ORG: ${{secrets.CPLN_ORG_STAGING}}
17-
CPLN_TOKEN: ${{secrets.CPLN_TOKEN_STAGING}}
16+
CPLN_ORG: ${{ vars.CPLN_ORG_STAGING }}
17+
CPLN_TOKEN: ${{ secrets.CPLN_TOKEN_STAGING }}
1818

1919
jobs:
2020
deploy-to-control-plane-staging:
@@ -28,5 +28,5 @@ jobs:
2828

2929
- uses: ./.github/actions/deploy-to-control-plane@justin808-working-for-deploys
3030
with:
31-
app_name: ${{ secrets.APP_NAME_STAGING }}
32-
org: ${{ secrets.CPLN_ORG_STAGING }}
31+
app_name: ${{ vars.STAGING_APP_NAME }}
32+
org: ${{ vars.CPLN_ORG_STAGING }}

.github/workflows/deploy-to-control-plane.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ concurrency:
1515

1616
env:
1717
APP_NAME: qa-react-webpack-rails-tutorial-pr-${{ github.event.pull_request.number || github.event.issue.number }}
18-
CPLN_ORG: ${{ secrets.CPLN_ORG_STAGING }}
1918
CPLN_TOKEN: ${{ secrets.CPLN_TOKEN_STAGING }}
19+
CPLN_ORG: ${{ vars.CPLN_ORG_STAGING }}
2020
PR_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }}
2121

2222
jobs:
@@ -25,7 +25,7 @@ jobs:
2525
(github.event_name == 'pull_request') ||
2626
(github.event_name == 'issue_comment' &&
2727
github.event.issue.pull_request &&
28-
github.event.comment.body == '/deploy')
28+
github.event.comment.body == '/deploy-review-app')
2929
runs-on: ubuntu-latest
3030
permissions:
3131
contents: read

.github/workflows/help-command.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,105 @@ jobs:
1818
github.event.comment.body == '/help')
1919
runs-on: ubuntu-latest
2020

21+
steps:
22+
- name: Show Available Commands
23+
uses: actions/github-script@v7
24+
with:
25+
script: |
26+
try {
27+
console.log('Creating detailed help message...');
28+
const helpMessage = [
29+
'# 📚 Detailed Review App Commands Guide',
30+
'',
31+
'This is a detailed guide to using review app commands. For a quick reference, see the message posted when your PR was created.',
32+
'',
33+
'## Available Commands',
34+
'',
35+
'### `/deploy-review-app`',
36+
'Deploys your PR branch to a review environment on Control Plane.',
37+
'- Creates a new review app if one doesn\'t exist',
38+
'- Updates the existing review app if it already exists',
39+
'- Provides a unique URL to preview your changes',
40+
'- Shows build and deployment progress in real-time',
41+
'',
42+
'**Required Environment Secrets:**',
43+
'- `CPLN_TOKEN_STAGING`: Control Plane authentication token',
44+
'- `CPLN_TOKEN_PRODUCTION`: Control Plane authentication token',
45+
'',
46+
'**Required GitHub Actions Variables:**',
47+
'- `CPLN_ORG_STAGING`: Control Plane authentication token',
48+
'- `CPLN_ORG_PRODUCTION`: Control Plane authentication token',
49+
'',
50+
'**Required GitHub Actions Variables (these need to match your control_plane.yml file:**',
51+
'- `PRODUCTION_APP_NAME`: Control Plane production app name',
52+
'- `STAGING_APP_NAME`: Control Plane staging app name',
53+
'- `REVIEW_APP_PREFIX`: Control Plane review app prefix',
54+
'',
55+
'**Optional Configuration:**',
56+
'- `WAIT_TIMEOUT`: Deployment timeout in seconds (default: 900)',
57+
' - Must be a positive integer',
58+
' - Can be set in GitHub Actions variables',
59+
' - Applies to both deployment and workload readiness checks',
60+
'',
61+
'### `/delete-review-app`',
62+
'Deletes the review app associated with this PR.',
63+
'- Removes all resources from Control Plane',
64+
'- Helpful for cleaning up when you\'re done testing',
65+
'- Can be re-deployed later using `/deploy-review-app`',
66+
'',
67+
'**Required Environment Variables:**',
68+
'- `CPLN_TOKEN`: Control Plane authentication token',
69+
'- `CPLN_ORG`: Control Plane organization name',
70+
'',
71+
'### `/help`',
72+
'Shows this detailed help message.',
73+
'',
74+
'---',
75+
'## Environment Setup',
76+
'',
77+
'1. Set required secrets in your repository settings:',
78+
' - `CPLN_TOKEN`',
79+
' - `CPLN_ORG`',
80+
'',
81+
'2. Optional: Configure `WAIT_TIMEOUT` in GitHub Actions variables to customize deployment timeout',
82+
'',
83+
'## Control Plane Integration',
84+
'',
85+
'Review apps are deployed to Control Plane with the following configuration:',
86+
'- App Name Format: `qa-react-webpack-rails-tutorial-pr-{PR_NUMBER}`',
87+
'- Console URL: `https://console.cpln.io/console/org/{CPLN_ORG}/gvc/{APP_NAME}/-info`',
88+
'',
89+
'## Automatic Cleanup',
90+
'',
91+
'Review apps are automatically deleted when:',
92+
'- The PR is closed (merged or not merged)',
93+
'- The PR is stale (via nightly cleanup job)',
94+
'',
95+
'For more information, see the [React on Rails Tutorial documentation](https://github.com/shakacode/react-on-rails/tree/master/react-webpack-rails-tutorial)'
96+
].join('\n');
97+
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+
21120
steps:
22121
- name: Show Available Commands
23122
uses: actions/github-script@v7

0 commit comments

Comments
 (0)