From 45b512ca561819498ad2b9dd8696f1ac9859bdb5 Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Mon, 27 Jan 2025 22:15:05 -1000 Subject: [PATCH] fixes --- .github/actions/deploy-to-control-plane/action.yml | 11 ++++++++++- .github/workflows/deploy-to-control-plane.yml | 8 ++------ .github/workflows/help-command.yml | 6 +++--- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/actions/deploy-to-control-plane/action.yml b/.github/actions/deploy-to-control-plane/action.yml index b5282ce8..3ec17068 100644 --- a/.github/actions/deploy-to-control-plane/action.yml +++ b/.github/actions/deploy-to-control-plane/action.yml @@ -17,6 +17,12 @@ inputs: description: 'Timeout in seconds for waiting for workloads to be ready' required: false default: '900' + cpln_token: + description: 'Control Plane token' + required: true + pr_number: + description: 'Pull Request number' + required: true outputs: review_app_url: @@ -50,11 +56,14 @@ runs: run: ${{ github.action_path }}/scripts/get-commit-sha.sh env: GITHUB_TOKEN: ${{ inputs.github_token }} - PR_NUMBER: ${{ env.PR_NUMBER }} + PR_NUMBER: ${{ inputs.pr_number }} - name: Deploy to Control Plane id: deploy shell: bash + env: + CPLN_TOKEN: ${{ inputs.cpln_token }} + PR_NUMBER: ${{ inputs.pr_number }} run: | echo "🚀 Deploying app for PR #${PR_NUMBER}..." diff --git a/.github/workflows/deploy-to-control-plane.yml b/.github/workflows/deploy-to-control-plane.yml index 680c7f49..597592bd 100644 --- a/.github/workflows/deploy-to-control-plane.yml +++ b/.github/workflows/deploy-to-control-plane.yml @@ -103,9 +103,6 @@ jobs: - name: Check if Review App Exists id: check-app - if: github.event_name == 'push' - env: - CPLN_TOKEN: ${{ secrets.CPLN_TOKEN }} run: | if ! cpflow exists -a ${{ env.APP_NAME }}; then echo "No review app exists for this PR" @@ -283,9 +280,8 @@ jobs: org: ${{ env.CPLN_ORG }} github_token: ${{ secrets.GITHUB_TOKEN }} wait_timeout: ${{ vars.WAIT_TIMEOUT || 900 }} - env: - CPLN_TOKEN: ${{ env.CPLN_TOKEN }} - PR_NUMBER: ${{ env.PR_NUMBER }} + cpln_token: ${{ secrets.CPLN_TOKEN_STAGING }} + pr_number: ${{ env.PR_NUMBER }} - name: Update Status - Deployment Complete uses: actions/github-script@v7 diff --git a/.github/workflows/help-command.yml b/.github/workflows/help-command.yml index b7651686..f8783540 100644 --- a/.github/workflows/help-command.yml +++ b/.github/workflows/help-command.yml @@ -30,8 +30,8 @@ jobs: - name: Checkout uses: actions/checkout - - name: Show Help Information - uses: shakacode/shared-actions/help-command@justin808-more-work-on-review-apps-2 + - name: Process Help Command + uses: shakacode/react-webpack-rails-tutorial/.github/actions/help-command@justin808-more-work-on-review-apps-2 with: github-token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.inputs.issue-number }} + issue-number: ${{ github.event.inputs.issue-number }} \ No newline at end of file