- 
  Notifications
 You must be signed in to change notification settings 
- Fork 380
Building on working for review apps #620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
15cd558
 ebf0795
 b731dde
 625afa8
 813130a
 cb5ce31
 3ca76cd
 File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -13,8 +13,8 @@ permissions: | |
| issues: write | ||
|  | ||
| env: | ||
| CPLN_ORG: ${{ secrets.CPLN_ORG }} | ||
| CPLN_TOKEN: ${{ secrets.CPLN_TOKEN }} | ||
| CPLN_ORG: ${{ vars.CPLN_ORG_STAGING }} | ||
| CPLN_TOKEN: ${{ secrets.CPLN_TOKEN_STAGING }} | ||
| APP_NAME: qa-react-webpack-rails-tutorial-pr-${{ github.event.pull_request.number || github.event.issue.number }} | ||
| PR_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }} | ||
|  | ||
|  | @@ -29,6 +29,18 @@ jobs: | |
| runs-on: ubuntu-latest | ||
|  | ||
| steps: | ||
| - name: Get PR number | ||
| id: pr | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const prNumber = context.payload.issue.number; | ||
| core.setOutput('pr_number', prNumber); | ||
| core.exportVariable('PR_NUMBER', prNumber); | ||
|  | ||
| - name: Set App Name | ||
| run: echo "APP_NAME=qa-react-webpack-rails-tutorial-pr-${{ env.PR_NUMBER }}" >> $GITHUB_ENV | ||
|  | ||
| - uses: actions/checkout@v4 | ||
|  | ||
| - name: Validate Required Secrets | ||
|  | @@ -46,7 +58,10 @@ jobs: | |
| fi | ||
|  | ||
| - name: Setup Environment | ||
| uses: ./.github/actions/setup-environment | ||
| uses: ./.github/actions/setup-environment@justin808-working-for-deploys | ||
| with: | ||
| org: ${{ env.CPLN_ORG }} | ||
| token: ${{ env.CPLN_TOKEN }} | ||
|  | ||
| - name: Set shared functions | ||
| id: shared-functions | ||
|  | @@ -105,23 +120,26 @@ jobs: | |
| issue_number: process.env.PR_NUMBER, | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| body: '🗑️ Starting app deletion...' | ||
| body: [ | ||
| message, | ||
| '', | ||
| ' [View Delete Logs](' + process.env.WORKFLOW_URL + ')', | ||
| ' 🗑️ [View Delete Logs](' + process.env.WORKFLOW_URL + ')', | ||
| '', | ||
| getConsoleLink(process.env.PR_NUMBER) | ||
| ].join('\n') | ||
| }); | ||
| return { commentId: comment.data.id }; | ||
|  | ||
| - name: Delete Review App | ||
| uses: ./.github/actions/delete-control-plane-app | ||
| uses: ./.github/actions/delete-control-plane-app@justin808-working-for-deploys | ||
| with: | ||
| app_name: ${{ env.APP_NAME }} | ||
| org: ${{ env.CPLN_ORG }} | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| env: | ||
| APP_NAME: ${{ env.APP_NAME }} | ||
| CPLN_ORG: ${{ secrets.CPLN_ORG }} | ||
| CPLN_TOKEN: ${{ secrets.CPLN_TOKEN }} | ||
| 
 Comment on lines
 
 +135
  to 
 143
 
  There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix environment variable inconsistency in delete app step. The step redefines  uses: ./.github/actions/delete-control-plane-app@justin808-working-for-deploys
with:
 app_name: ${{ env.APP_NAME }}
 org: ${{ env.CPLN_ORG }}
 github_token: ${{ secrets.GITHUB_TOKEN }}
env:
 APP_NAME: ${{ env.APP_NAME }}
- CPLN_ORG: ${{ secrets.CPLN_ORG }}
- CPLN_TOKEN: ${{ secrets.CPLN_TOKEN }}📝 Committable suggestion
 
 Suggested change
   
  uses: ./.github/actions/delete-control-plane-app@justin808-working-for-deploys
   
  with:
   
  app_name: ${{ env.APP_NAME }}
   
  org: ${{ env.CPLN_ORG }}
   
  github_token: ${{ secrets.GITHUB_TOKEN }}
   
  env:
   
  APP_NAME: ${{ env.APP_NAME }}
   
  CPLN_ORG: ${{ secrets.CPLN_ORG }}
   
  CPLN_TOKEN: ${{ secrets.CPLN_TOKEN }}
   
  uses: ./.github/actions/delete-control-plane-app@justin808-working-for-deploys
   
  with:
   
  app_name: ${{ env.APP_NAME }}
   
  org: ${{ env.CPLN_ORG }}
   
  github_token: ${{ secrets.GITHUB_TOKEN }}
   
  env:
   
  APP_NAME: ${{ env.APP_NAME }}
  | ||
|  | ||
| - name: Update Delete Status | ||
|  | @@ -133,6 +151,7 @@ jobs: | |
|  | ||
| const success = '${{ job.status }}' === 'success'; | ||
| const prNumber = process.env.PR_NUMBER; | ||
| const cpConsoleUrl = `https://console.cpln.io/org/${process.env.CPLN_ORG}/workloads/${process.env.APP_NAME}`; | ||
|  | ||
| const successMessage = [ | ||
| '✅ Review app for PR #' + prNumber + ' was successfully deleted', | ||
|  | ||