Skip to content

Commit 1454772

Browse files
committed
composite actions cant use secrets
1 parent 8f7c638 commit 1454772

File tree

4 files changed

+46
-53
lines changed

4 files changed

+46
-53
lines changed

.github/actions/deploy-to-control-plane/action.yml

-7
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,10 @@ inputs:
1010
org:
1111
description: 'Organization name'
1212
required: true
13-
github_token:
14-
description: 'GitHub token'
15-
required: true
1613
wait_timeout:
1714
description: 'Timeout in seconds for waiting for workloads to be ready'
1815
required: false
1916
default: '900'
20-
cpln_token:
21-
description: 'Control Plane token'
22-
required: true
2317
pr_number:
2418
description: 'Pull Request number'
2519
required: true
@@ -38,7 +32,6 @@ runs:
3832
env:
3933
APP_NAME: ${{ inputs.app_name }}
4034
CPLN_ORG: ${{ inputs.org }}
41-
CPLN_TOKEN: ${{ inputs.cpln_token }}
4235
WAIT_TIMEOUT: ${{ inputs.wait_timeout }}
4336
run: |
4437
# Run the deployment script

.github/actions/validate-required-vars/action.yml

-41
This file was deleted.

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

+23-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ permissions:
1919
issues: write
2020

2121
env:
22+
PREFIX: ${{ vars.REVIEW_APP_PREFIX }}
2223
CPLN_ORG: ${{ vars.CPLN_ORG_STAGING }}
2324
CPLN_TOKEN: ${{ secrets.CPLN_TOKEN_STAGING }}
2425
APP_NAME: ${{ vars.REVIEW_APP_PREFIX }}-pr-${{ github.event.pull_request.number || github.event.issue.number || inputs.pr_number }}
@@ -43,7 +44,28 @@ jobs:
4344
- uses: actions/checkout@v4
4445

4546
- name: Validate Required Secrets and Variables
46-
uses: ./.github/actions/validate-required-vars
47+
shell: bash
48+
run: |
49+
missing=()
50+
51+
# Check required secrets
52+
if [ -z "$CPLN_TOKEN" ]; then
53+
missing+=("Secret: CPLN_TOKEN_STAGING")
54+
fi
55+
56+
# Check required variables
57+
if [ -z "$CPLN_ORG" ]; then
58+
missing+=("Variable: CPLN_ORG_STAGING")
59+
fi
60+
61+
if [ -z "$"PREFIX" }} ]; then
62+
missing+=("Variable: REVIEW_APP_PREFIX")
63+
fi
64+
65+
if [ ${#missing[@]} -ne 0 ]; then
66+
echo "Required secrets/variables are not set: ${missing[*]}"
67+
exit 1
68+
fi
4769
4870
- name: Setup Environment
4971
uses: ./.github/actions/setup-environment

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

+23-4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ concurrency:
2424
cancel-in-progress: true
2525

2626
env:
27+
PREFIX: ${{ vars.REVIEW_APP_PREFIX }}
2728
APP_NAME: ${{ vars.REVIEW_APP_PREFIX }}-pr-${{ github.event.pull_request.number || github.event.issue.number || github.event.inputs.pr_number }}
2829
CPLN_TOKEN: ${{ secrets.CPLN_TOKEN_STAGING }}
2930
CPLN_ORG: ${{ vars.CPLN_ORG_STAGING }}
@@ -70,10 +71,28 @@ jobs:
7071
fetch-depth: 0
7172

7273
- name: Validate Required Secrets and Variables
73-
uses: ./.github/actions/validate-required-vars
74-
with:
75-
prefix: ${{ vars.REVIEW_APP_PREFIX }}
76-
org: ${{ vars.CPLN_ORG_STAGING }}
74+
shell: bash
75+
run: |
76+
missing=()
77+
78+
# Check required secrets
79+
if [ -z "$CPLN_TOKEN" ]; then
80+
missing+=("Secret: CPLN_TOKEN_STAGING")
81+
fi
82+
83+
# Check required variables
84+
if [ -z "$CPLN_ORG" ]; then
85+
missing+=("Variable: CPLN_ORG_STAGING")
86+
fi
87+
88+
if [ -z "$"PREFIX" ]; then
89+
missing+=("Variable: REVIEW_APP_PREFIX")
90+
fi
91+
92+
if [ ${#missing[@]} -ne 0 ]; then
93+
echo "Required secrets/variables are not set: ${missing[*]}"
94+
exit 1
95+
fi
7796
7897
- name: Get PR HEAD Ref
7998
id: getRef

0 commit comments

Comments
 (0)